From 8b4b954332d830bc1e8429ab70f3a191f13072b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Fri, 22 May 2020 03:36:42 +0200 Subject: [PATCH] Fix error handling on invalid regex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Say that the regex is the cause, include it in the error message, and don't continue as if the compilation succeeded. Signed-off-by: Miloslav Trmač --- cmd/skopeo/sync.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/skopeo/sync.go b/cmd/skopeo/sync.go index 07939c9c..e33350a2 100644 --- a/cmd/skopeo/sync.go +++ b/cmd/skopeo/sync.go @@ -344,8 +344,11 @@ func imagesToCopyFromRegistry(registryName string, cfg registrySyncConfig, sourc tagReg, err := regexp.Compile(tagRegex) if err != nil { - repoLogger.Error("Error processing repo, skipping") + repoLogger.WithFields(logrus.Fields{ + "regex": tagRegex, + }).Error("Error parsing regex, skipping") logrus.Error(err) + continue } repoLogger.Info("Querying registry for image tags")