Check chart controller image tag

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-03-15 12:37:59 -03:00
parent 130af33510
commit e9641ba08e
3 changed files with 11 additions and 0 deletions

View file

@ -146,3 +146,12 @@ Return the appropriate apiVersion for podSecurityPolicy.
{{- print "extensions/v1beta1" -}}
{{- 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" .Values.controller.image.tag) -}}
{{- fail "Controller container image tag should be 0.27.0 or higher" -}}
{{- end -}}
{{- end -}}

View file

@ -1,4 +1,5 @@
{{- if or (eq .Values.controller.kind "DaemonSet") (eq .Values.controller.kind "Both") -}}
{{- include "isControllerTagValid" . -}}
apiVersion: {{ template "daemonset.apiVersion" . }}
kind: DaemonSet
metadata:

View file

@ -1,4 +1,5 @@
{{- if or (eq .Values.controller.kind "Deployment") (eq .Values.controller.kind "Both") -}}
{{- include "isControllerTagValid" . -}}
apiVersion: {{ template "deployment.apiVersion" . }}
kind: Deployment
metadata: