Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart: Remove isControllerTagValid. #11714

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions charts/ingress-nginx/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,6 @@ Return the appropriate apiGroup for PodSecurityPolicy.
{{- 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.
*/}}
Expand Down
1 change: 0 additions & 1 deletion charts/ingress-nginx/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- if eq .Values.controller.kind "DaemonSet" -}}
{{- include "isControllerTagValid" . -}}
apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down
1 change: 0 additions & 1 deletion charts/ingress-nginx/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- if eq .Values.controller.kind "Deployment" -}}
{{- include "isControllerTagValid" . -}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
10 changes: 10 additions & 0 deletions charts/ingress-nginx/tests/controller-daemonset_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,13 @@ tests:
topologyKey: kubernetes.io/hostname
maxSkew: 1
whenUnsatisfiable: ScheduleAnyway

- 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
9 changes: 9 additions & 0 deletions charts/ingress-nginx/tests/controller-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,12 @@ tests:
topologyKey: kubernetes.io/hostname
maxSkew: 1
whenUnsatisfiable: ScheduleAnyway

- 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