implement code review

This commit is contained in:
patst 2023-12-08 09:41:28 +01:00
parent fb35d87aa9
commit 759c91f8eb
7 changed files with 20 additions and 19 deletions

View file

@ -8,4 +8,6 @@ controller:
extraModules:
- name: opentelemetry
image:
registry: registry.k8s.io
image: busybox
tag: latest

View file

@ -10,4 +10,6 @@ controller:
extraModules:
- name: opentelemetry
image:
registry: registry.k8s.io
image: busybox
tag: latest

View file

@ -8,6 +8,8 @@ controller:
extraModules:
- name: opentelemetry
image:
registry: registry.k8s.io
image: busybox
tag: latest
containerSecurityContext:
allowPrivilegeEscalation: false

View file

@ -8,4 +8,6 @@ controller:
extraModules:
- name: opentelemetry
image:
registry: registry.k8s.io
image: busybox
tag: latest

View file

@ -2,6 +2,3 @@ controller:
kind: Deployment
opentelemetry:
enabled: true
image:
registry: registry.k8s.io
image: ingress-nginx/opentelemetry

View file

@ -257,15 +257,17 @@ Extra modules.
*/}}
{{- define "extraModules" -}}
- name: {{ .name }}
image: {{ include "imageName" .image }}{{ include "ingress-nginx.imageDigest" .image }}
{{- with .image }}
image: {{ if .repository }}{{ .repository }}{{ else }}{{ .registry }}/{{ .image }}{{ end }}:{{ .tag }}{{ if .digest }}@{{ .digest }}{{ end }}
command:
{{- if .image.distroless }}
{{- if .distroless }}
- /init_module
{{- else }}
- sh
- -c
- /usr/local/bin/init_module.sh
{{- end }}
{{- end }}
{{- if .containerSecurityContext }}
securityContext: {{ toYaml .containerSecurityContext | nindent 4 }}
{{- end }}
@ -276,16 +278,3 @@ 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 -}}

View file

@ -590,7 +590,11 @@ controller:
# image:
# registry: registry.k8s.io
# image: ingress-nginx/mytestmodule
# tag: latest
# ## for backwards compatibility consider setting the full image url via the repository value below
# ## use *either* current default registry/image or repository format or installing chart by providing the values.yaml will fail
# ## repository:
# tag: "v1.0.0"
# digest: ""
# distroless: false
# containerSecurityContext:
# runAsNonRoot: true
@ -614,6 +618,9 @@ controller:
image:
registry: registry.k8s.io
image: ingress-nginx/opentelemetry
## for backwards compatibility consider setting the full image url via the repository value below
## use *either* current default registry/image or repository format or installing chart by providing the values.yaml will fail
## repository:
tag: "v20230721-3e2062ee5"
digest: sha256:13bee3f5223883d3ca62fee7309ad02d22ec00ff0d7033e3e9aca7a9f60fd472
distroless: true