From 3a05dca94e06a2d8d3f7bf446d80c79c332ba07f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Fri, 2 Sep 2022 00:03:30 +0200 Subject: [PATCH] Don't abort sync if the registry returns invalid tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The user is not very likely to be able to do anything about that, and we have no other way to read those images - so just skip them; we already skip image copies in much more directly user-caused situations, including invalid user-provided strings. Signed-off-by: Miloslav Trmač --- cmd/skopeo/sync.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/skopeo/sync.go b/cmd/skopeo/sync.go index 9f2f1f32..a304aa39 100644 --- a/cmd/skopeo/sync.go +++ b/cmd/skopeo/sync.go @@ -244,7 +244,11 @@ func imagesToCopyFromRepo(sys *types.SystemContext, repoRef reference.Named) ([] for _, tag := range tags { taggedRef, err := reference.WithTag(repoRef, tag) if err != nil { - return nil, fmt.Errorf("Error creating a reference for repository %s and tag %q: %w", repoRef.Name(), tag, err) + logrus.WithFields(logrus.Fields{ + "repo": repoRef.Name(), + "tag": tag, + }).Errorf("Error creating a tagged reference from registry tag list: %v", err) + continue } ref, err := docker.NewReference(taggedRef) if err != nil {