Refactor template to generate the image name
* adapt test cases for extraModules
This commit is contained in:
parent
e60de52616
commit
fb35d87aa9
5 changed files with 22 additions and 5 deletions
|
@ -7,4 +7,5 @@ controller:
|
|||
type: ClusterIP
|
||||
extraModules:
|
||||
- name: opentelemetry
|
||||
image: busybox
|
||||
image:
|
||||
image: busybox
|
||||
|
|
|
@ -9,4 +9,5 @@ controller:
|
|||
allowPrivilegeEscalation: false
|
||||
extraModules:
|
||||
- name: opentelemetry
|
||||
image: busybox
|
||||
image:
|
||||
image: busybox
|
||||
|
|
|
@ -7,6 +7,7 @@ controller:
|
|||
type: ClusterIP
|
||||
extraModules:
|
||||
- name: opentelemetry
|
||||
image: busybox
|
||||
image:
|
||||
image: busybox
|
||||
containerSecurityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
|
|
|
@ -7,4 +7,5 @@ controller:
|
|||
type: ClusterIP
|
||||
extraModules:
|
||||
- name: opentelemetry
|
||||
image: busybox
|
||||
image:
|
||||
image: busybox
|
||||
|
|
|
@ -257,7 +257,7 @@ Extra modules.
|
|||
*/}}
|
||||
{{- define "extraModules" -}}
|
||||
- name: {{ .name }}
|
||||
image: {{ printf "%s/%s:%s" .image.registry .image.image .image.tag }}{{ include "ingress-nginx.imageDigest" .image }}
|
||||
image: {{ include "imageName" .image }}{{ include "ingress-nginx.imageDigest" .image }}
|
||||
command:
|
||||
{{- if .image.distroless }}
|
||||
- /init_module
|
||||
|
@ -276,3 +276,16 @@ Extra modules.
|
|||
- name: modules
|
||||
mountPath: /modules_mount
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Image Name with optional registry and tag.
|
||||
*/}}
|
||||
{{- define "imageName" -}}
|
||||
{{- if .registry -}}
|
||||
{{- printf "%s/" .registry -}}
|
||||
{{- end -}}
|
||||
{{- printf "%s" .image -}}
|
||||
{{- if .tag -}}
|
||||
{{- printf ":%s" .tag -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
Loading…
Reference in a new issue