Skip to content

Commit

Permalink
Ignore empty params
Browse files Browse the repository at this point in the history
Signed-off-by: Ling Samuel <[email protected]>
  • Loading branch information
lingsamuel committed Jan 12, 2021
1 parent dd66adb commit f7f1ca0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/minikube/assets/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{}
if images != "" {
for _, image := range strings.Split(images, ",") {
vals := strings.Split(image, "=")
if len(vals) != 2 {
if len(vals) != 2 || vals[1] == "" {
out.WarningT("Ignoring invalid custom image {{.conf}}", out.V{"conf": image})
continue
}
Expand All @@ -654,7 +654,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{}
if registries != "" {
for _, registry := range strings.Split(registries, ",") {
vals := strings.Split(registry, "=")
if len(vals) != 2 {
if len(vals) != 2 || vals[1] == "" {
out.WarningT("Ignoring invalid custom registry {{.conf}}", out.V{"conf": registry})
continue
}
Expand All @@ -668,7 +668,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{}

// Append postfix "/" to registries
for k, v := range opts.Registries {
if !strings.HasSuffix(opts.Registries[k], "/") {
if opts.Registries[k] != "" && !strings.HasSuffix(opts.Registries[k], "/") {
opts.Registries[k] = v + "/"
}
}
Expand Down

0 comments on commit f7f1ca0

Please sign in to comment.