Skip to content

Commit

Permalink
rewrite func getImageNameTag for supporting registries with port
Browse files Browse the repository at this point in the history
Signed-off-by: artem198315 <[email protected]>
  • Loading branch information
artem198315 authored and artem198315 committed Aug 2, 2023
1 parent 82e861c commit ea891f6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions pkg/helm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,19 @@ func valueWithDefault(name string, def int) (int, error) {
}

func getImageNameTag(envValue string) (string, string) {
img := strings.Split(envValue, ":")
var img []string
var repoPath string

pos := strings.LastIndex(envValue, "/")
if pos > 0 {
img = strings.Split(envValue[pos+1:], ":")
repoPath = envValue[:pos] + "/"
} else {
img = strings.Split(envValue, ":")
}

if len(img) == 1 {
return img[0], ""
return repoPath + img[0], ""
}
return img[0], img[1]
return repoPath + img[0], img[1]
}

0 comments on commit ea891f6

Please sign in to comment.