Remove default image from yaml, fix empty images warning
Signed-off-by: Ling Samuel <lingsamuelgrace@gmail.com>pull/10111/head
parent
a49d91524b
commit
7b2d1a6838
|
@ -49,7 +49,7 @@ spec:
|
|||
serviceAccountName: ingress-nginx
|
||||
containers:
|
||||
- name: controller
|
||||
image: {{default "us.gcr.io/k8s-artifacts-prod" .ImageRepository}}/{{default "ingress-nginx/controller:v0.40.2" .Images.IngressController}}
|
||||
image: {{default "us.gcr.io/k8s-artifacts-prod" .ImageRepository}}/{{.Images.IngressController}}
|
||||
imagePullPolicy: IfNotPresent
|
||||
lifecycle:
|
||||
preStop:
|
||||
|
@ -220,7 +220,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: create
|
||||
image: {{default "jettech" .ImageRepository}}/{{default "kube-webhook-certgen:v1.2.2" .Images.KubeWebhookCertgenCreate}}
|
||||
image: {{default "jettech" .ImageRepository}}/{{.Images.KubeWebhookCertgenCreate}}
|
||||
imagePullPolicy: IfNotPresent
|
||||
args:
|
||||
- create
|
||||
|
@ -255,7 +255,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: patch
|
||||
image: {{default "jettech" .ImageRepository}}/{{default "kube-webhook-certgen:v1.3.0" .Images.KubeWebhookCertgenPatch}}
|
||||
image: {{default "jettech" .ImageRepository}}/{{.Images.KubeWebhookCertgenPatch}}
|
||||
imagePullPolicy:
|
||||
args:
|
||||
- patch
|
||||
|
|
|
@ -521,16 +521,18 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{}
|
|||
}
|
||||
|
||||
images := viper.GetString(config.AddonImages)
|
||||
for _, image := range strings.Split(images, ",") {
|
||||
vals := strings.Split(image, "=")
|
||||
if len(vals) != 2 {
|
||||
out.WarningT("Ignoring invalid custom image {{.conf}}", out.V{"conf": image})
|
||||
continue
|
||||
if images != "" {
|
||||
for _, image := range strings.Split(images, ",") {
|
||||
vals := strings.Split(image, "=")
|
||||
if len(vals) != 2 {
|
||||
out.WarningT("Ignoring invalid custom image {{.conf}}", out.V{"conf": image})
|
||||
continue
|
||||
}
|
||||
if defaultImage, ok := opts.Images[vals[0]]; ok {
|
||||
out.Infof("Using {{.image}} instead default image {{.default}}", out.V{"image": vals[1], "name": defaultImage})
|
||||
}
|
||||
opts.Images[vals[0]] = vals[1]
|
||||
}
|
||||
if defaultImage, ok := opts.Images[vals[0]]; ok {
|
||||
out.Infof("Using {{.image}} instead default image {{.default}}", out.V{"image": vals[1], "name": defaultImage})
|
||||
}
|
||||
opts.Images[vals[0]] = vals[1]
|
||||
}
|
||||
|
||||
return opts
|
||||
|
|
Loading…
Reference in New Issue