From e6295a6a1ac510aabef52add157f65c339f6ad93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20=C3=81vila?= Date: Wed, 17 Jul 2024 11:04:02 +0200 Subject: [PATCH 1/3] Added new logging info on registry Added new log at the end of listArchs, to log for each container which platforms are being selected. --- pkg/registry/registry.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/registry/registry.go b/pkg/registry/registry.go index e201c3d..8de8078 100644 --- a/pkg/registry/registry.go +++ b/pkg/registry/registry.go @@ -598,10 +598,11 @@ func (r *PlainRegistry) ListArchs(ctx context.Context, imagePullSecret, image st if len(platforms) == 0 { platforms = append(platforms, Platform{Architecture: "amd64", OS: "linux"}) } + log.DefaultLogger.WithContext(ctx).Printf("For container %s/%s:%s platforms founded: %v\n", registry, image, tag, platforms) return platforms, nil } if err != nil { return nil, err } - return nil, errors.New("Unable to find image architecture") + return nil, errors.New("unable to find image architecture") } From 7f4ae9318cc2ffc9a2fe3042c94a52620fb05134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20=C3=81vila?= Date: Wed, 17 Jul 2024 11:46:46 +0200 Subject: [PATCH 2/3] Update pkg/registry/registry.go Co-authored-by: Thibault Jamet --- pkg/registry/registry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/registry/registry.go b/pkg/registry/registry.go index 6d5fa6f..b796f95 100644 --- a/pkg/registry/registry.go +++ b/pkg/registry/registry.go @@ -598,7 +598,7 @@ func (r *PlainRegistry) ListArchs(ctx context.Context, imagePullSecret, image st if len(platforms) == 0 { platforms = append(platforms, Platform{Architecture: "amd64", OS: "linux"}) } - log.DefaultLogger.WithContext(ctx).Printf("For container %s/%s:%s platforms founded: %v\n", registry, image, tag, platforms) + log.DefaultLogger.WithContext(ctx).WithField("platforms": platforms).Debug("Found image architecture") return platforms, nil } if err != nil { From 42ef7f8e2ba6d984c6f784d3aadc0ac8b35b9f6d Mon Sep 17 00:00:00 2001 From: Thibault Jamet Date: Wed, 17 Jul 2024 13:24:41 +0200 Subject: [PATCH 3/3] Update pkg/registry/registry.go --- pkg/registry/registry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/registry/registry.go b/pkg/registry/registry.go index b796f95..27c4889 100644 --- a/pkg/registry/registry.go +++ b/pkg/registry/registry.go @@ -598,7 +598,7 @@ func (r *PlainRegistry) ListArchs(ctx context.Context, imagePullSecret, image st if len(platforms) == 0 { platforms = append(platforms, Platform{Architecture: "amd64", OS: "linux"}) } - log.DefaultLogger.WithContext(ctx).WithField("platforms": platforms).Debug("Found image architecture") + log.DefaultLogger.WithContext(ctx).WithField("platforms", platforms).Debug("Found image architecture") return platforms, nil } if err != nil {