From cf6a71de810f2903bf24f7035c4250004a828dc4 Mon Sep 17 00:00:00 2001 From: Simon Aronsson Date: Mon, 21 Dec 2020 18:11:08 +0100 Subject: [PATCH] fix linting issues --- pkg/registry/auth/auth.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/registry/auth/auth.go b/pkg/registry/auth/auth.go index 8e7be4a40..ae708b631 100644 --- a/pkg/registry/auth/auth.go +++ b/pkg/registry/auth/auth.go @@ -150,6 +150,7 @@ func GetAuthURL(challenge string, img string) (*url.URL, error) { return authURL, nil } +// GetScopeFromImageName normalizes an image name for use as scope during auth and head requests func GetScopeFromImageName(img, svc string) string { parts := strings.Split(img, "/") scopeImage := "" @@ -164,7 +165,7 @@ func GetScopeFromImageName(img, svc string) string { if strings.Contains(parts[0], "docker.io") { scopeImage = fmt.Sprintf("library/%s", parts[1]) } else { - scopeImage = strings.Replace(img, svc + "/", "", 1) + scopeImage = strings.Replace(img, svc+"/", "", 1) } } else if strings.Contains(svc, "docker.io") { scopeImage = fmt.Sprintf("library/%s", parts[0])