Remove chart old podSecurityPolicy check

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-04-14 23:07:45 -04:00
parent d1de9051e8
commit 977178dea4
4 changed files with 4 additions and 15 deletions

View file

@ -114,17 +114,6 @@ Return the appropriate apiGroup for PodSecurityPolicy.
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{/*
Return the appropriate apiVersion for podSecurityPolicy.
*/}}
{{- define "podSecurityPolicy.apiVersion" -}}
{{- if semverCompare ">=1.10-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "policy/v1beta1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
{{/* {{/*
Check the ingress controller version tag is at most three versions behind the last release Check the ingress controller version tag is at most three versions behind the last release
*/}} */}}

View file

@ -1,5 +1,5 @@
{{- if .Values.podSecurityPolicy.enabled -}} {{- if .Values.podSecurityPolicy.enabled -}}
apiVersion: {{ template "podSecurityPolicy.apiVersion" . }} apiVersion: policy/v1beta1
kind: PodSecurityPolicy kind: PodSecurityPolicy
metadata: metadata:
name: {{ include "ingress-nginx.fullname" . }} name: {{ include "ingress-nginx.fullname" . }}

View file

@ -26,13 +26,13 @@ spec:
{{- if .Values.controller.service.loadBalancerSourceRanges }} {{- if .Values.controller.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{ toYaml .Values.controller.service.loadBalancerSourceRanges | nindent 4 }} loadBalancerSourceRanges: {{ toYaml .Values.controller.service.loadBalancerSourceRanges | nindent 4 }}
{{- end }} {{- end }}
{{- if and .Values.controller.service.externalTrafficPolicy (semverCompare ">=1.7-0" .Capabilities.KubeVersion.GitVersion) }} {{- if .Values.controller.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.controller.service.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.controller.service.externalTrafficPolicy }}
{{- end }} {{- end }}
{{- if .Values.controller.service.sessionAffinity }} {{- if .Values.controller.service.sessionAffinity }}
sessionAffinity: {{ .Values.controller.service.sessionAffinity }} sessionAffinity: {{ .Values.controller.service.sessionAffinity }}
{{- end }} {{- end }}
{{- if and .Values.controller.service.healthCheckNodePort (semverCompare ">=1.7-0" .Capabilities.KubeVersion.GitVersion) }} {{- if .Values.controller.service.healthCheckNodePort }}
healthCheckNodePort: {{ .Values.controller.service.healthCheckNodePort }} healthCheckNodePort: {{ .Values.controller.service.healthCheckNodePort }}
{{- end }} {{- end }}
ports: ports:

View file

@ -1,5 +1,5 @@
{{- if and .Values.podSecurityPolicy.enabled .Values.defaultBackend.enabled -}} {{- if and .Values.podSecurityPolicy.enabled .Values.defaultBackend.enabled -}}
apiVersion: {{ template "podSecurityPolicy.apiVersion" . }} apiVersion: policy/v1beta1
kind: PodSecurityPolicy kind: PodSecurityPolicy
metadata: metadata:
name: {{ include "ingress-nginx.fullname" . }}-backend name: {{ include "ingress-nginx.fullname" . }}-backend