From 7dd486cc49ce98340e51d8486f793801b1c9b7d1 Mon Sep 17 00:00:00 2001 From: Lukas Hoehl Date: Thu, 24 Jul 2025 12:22:38 +0200 Subject: [PATCH] chore(publish): log os/arch by reading config file if the goos and goarch don't match any manifest, the log output is wrong Signed-off-by: Lukas Hoehl --- pkg/build/oci/publish.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/build/oci/publish.go b/pkg/build/oci/publish.go index e1f825969..0e34f7bbb 100644 --- a/pkg/build/oci/publish.go +++ b/pkg/build/oci/publish.go @@ -142,7 +142,11 @@ func LoadIndex(ctx context.Context, idx v1.ImageIndex, tags []string) (name.Refe return name.Digest{}, fmt.Errorf("reading child image %q", useManifest.Digest.String()) } - log.Infof("using best guess single-arch image for local tags (%s/%s)", goos, goarch) + cf, err := img.ConfigFile() + if err != nil { + return name.Digest{}, fmt.Errorf("getting config file: %w", err) + } + log.Infof("using best guess single-arch image for local tags (%s/%s)", cf.OS, cf.Architecture) return LoadImage(ctx, img, tags) }