mirror of
https://github.com/containrrr/watchtower.git
synced 2025-02-19 20:00:01 +02:00
fix linting issues
This commit is contained in:
parent
eb8580f7f2
commit
cf6a71de81
@ -150,6 +150,7 @@ func GetAuthURL(challenge string, img string) (*url.URL, error) {
|
|||||||
return authURL, nil
|
return authURL, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetScopeFromImageName normalizes an image name for use as scope during auth and head requests
|
||||||
func GetScopeFromImageName(img, svc string) string {
|
func GetScopeFromImageName(img, svc string) string {
|
||||||
parts := strings.Split(img, "/")
|
parts := strings.Split(img, "/")
|
||||||
scopeImage := ""
|
scopeImage := ""
|
||||||
@ -164,7 +165,7 @@ func GetScopeFromImageName(img, svc string) string {
|
|||||||
if strings.Contains(parts[0], "docker.io") {
|
if strings.Contains(parts[0], "docker.io") {
|
||||||
scopeImage = fmt.Sprintf("library/%s", parts[1])
|
scopeImage = fmt.Sprintf("library/%s", parts[1])
|
||||||
} else {
|
} else {
|
||||||
scopeImage = strings.Replace(img, svc + "/", "", 1)
|
scopeImage = strings.Replace(img, svc+"/", "", 1)
|
||||||
}
|
}
|
||||||
} else if strings.Contains(svc, "docker.io") {
|
} else if strings.Contains(svc, "docker.io") {
|
||||||
scopeImage = fmt.Sprintf("library/%s", parts[0])
|
scopeImage = fmt.Sprintf("library/%s", parts[0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user