Chart: Remove isControllerTagValid
. (#11710)
This commit is contained in:
parent
b0f81825fe
commit
e972a35e98
5 changed files with 19 additions and 11 deletions
|
@ -246,15 +246,6 @@ Return the appropriate apiGroup for PodSecurityPolicy.
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
|
||||||
Check the ingress controller version tag is at most three versions behind the last release
|
|
||||||
*/}}
|
|
||||||
{{- define "isControllerTagValid" -}}
|
|
||||||
{{- if not (semverCompare ">=0.27.0-0" .Values.controller.image.tag) -}}
|
|
||||||
{{- fail "Controller container image tag should be 0.27.0 or higher" -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Extra modules.
|
Extra modules.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{{- if eq .Values.controller.kind "DaemonSet" -}}
|
{{- if eq .Values.controller.kind "DaemonSet" -}}
|
||||||
{{- include "isControllerTagValid" . -}}
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: DaemonSet
|
kind: DaemonSet
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{{- if eq .Values.controller.kind "Deployment" -}}
|
{{- if eq .Values.controller.kind "Deployment" -}}
|
||||||
{{- include "isControllerTagValid" . -}}
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -147,3 +147,13 @@ tests:
|
||||||
- equal:
|
- equal:
|
||||||
path: spec.template.spec.containers[0].securityContext.runAsGroup
|
path: spec.template.spec.containers[0].securityContext.runAsGroup
|
||||||
value: 1000
|
value: 1000
|
||||||
|
|
||||||
|
- it: should create a DaemonSet with a custom tag if `controller.image.tag` is set
|
||||||
|
set:
|
||||||
|
controller.kind: DaemonSet
|
||||||
|
controller.image.tag: my-little-custom-tag
|
||||||
|
controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.containers[0].image
|
||||||
|
value: registry.k8s.io/ingress-nginx/controller:my-little-custom-tag@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
|
||||||
|
|
|
@ -168,3 +168,12 @@ tests:
|
||||||
- equal:
|
- equal:
|
||||||
path: spec.template.spec.containers[0].securityContext.runAsGroup
|
path: spec.template.spec.containers[0].securityContext.runAsGroup
|
||||||
value: 1000
|
value: 1000
|
||||||
|
|
||||||
|
- it: should create a Deployment with a custom tag if `controller.image.tag` is set
|
||||||
|
set:
|
||||||
|
controller.image.tag: my-little-custom-tag
|
||||||
|
controller.image.digest: sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.containers[0].image
|
||||||
|
value: registry.k8s.io/ingress-nginx/controller:my-little-custom-tag@sha256:faa2d18687f734994b6bd9e309e7a73852a81c30e1b8f63165fcd4f0a087e3cd
|
||||||
|
|
Loading…
Reference in a new issue