Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
simskij committed Dec 21, 2020
1 parent eb8580f commit cf6a71d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/registry/auth/auth.go
Expand Up @@ -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 := ""
Expand All @@ -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])
Expand Down

0 comments on commit cf6a71d

Please sign in to comment.