From 2dd0ea93fc1a80169da88ee8ed3df09b9a9f1ae0 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Fri, 27 Mar 2026 16:49:48 -0700 Subject: [PATCH] Fix ImageExists to use skopeo instead of podman manifest inspect podman manifest inspect only works for multi-arch manifest lists, returning exit code 125 for regular single-arch images. Switch to skopeo inspect which works for both. Co-Authored-By: Claude Opus 4.6 (1M context) --- internal/runtime/podman.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/runtime/podman.go b/internal/runtime/podman.go index 0c66840..a6996e5 100644 --- a/internal/runtime/podman.go +++ b/internal/runtime/podman.go @@ -199,15 +199,16 @@ func (p *Podman) Push(ctx context.Context, image string) error { } // ImageExists checks whether an image tag exists in a remote registry. +// Uses skopeo inspect which works for both regular images and multi-arch +// manifests, unlike podman manifest inspect which only handles manifests. func (p *Podman) ImageExists(ctx context.Context, image string) (bool, error) { - cmd := exec.CommandContext(ctx, p.command(), "manifest", "inspect", "docker://"+image) //nolint:gosec // args built programmatically + cmd := exec.CommandContext(ctx, "skopeo", "inspect", "--tls-verify=false", "docker://"+image) //nolint:gosec // args built programmatically if err := cmd.Run(); err != nil { - // Exit code 1 means the manifest was not found. var exitErr *exec.ExitError - if ok := errors.As(err, &exitErr); ok && exitErr.ExitCode() == 1 { + if ok := errors.As(err, &exitErr); ok && exitErr.ExitCode() != 0 { return false, nil } - return false, fmt.Errorf("podman manifest inspect %q: %w", image, err) + return false, fmt.Errorf("skopeo inspect %q: %w", image, err) } return true, nil }