[stable/fluent-bit] Determine correct PodSecurityPolicy ApiGroup (#15355)

* Determine correct PodSecurityPolicy ApiGroup

PodSecurityPolicy API Group changed between Kubernetes version 1.13
(extensions) and 1.14 (policy)

Signed-off-by: Tim Hobbs <timothy.hobbs@ic-consult.com>

* Bump version

Signed-off-by: Tim Hobbs <timothy.hobbs@ic-consult.com>
This commit is contained in:
Tim Hobbs
2019-07-11 09:58:55 -07:00
committed by Kubernetes Prow Robot
parent 9baed0405e
commit b8bf0dd11c
3 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: fluent-bit
version: 2.4.1
version: 2.4.2
appVersion: 1.2.1
description: Fast and Lightweight Log/Data Forwarder for Linux, BSD and OSX
keywords:
+10
View File
@@ -55,3 +55,13 @@ Create the name of the service account to use
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiGroup for PodSecurityPolicy.
*/}}
{{- define "rbac.pspApiGroup" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "extensions" -}}
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "policy" -}}
{{- end -}}
{{- end -}}
@@ -17,7 +17,7 @@ rules:
- get
{{- if .Values.rbac.pspEnabled }}
- apiGroups:
- policy
- {{ template "rbac.pspApiGroup" . }}
resources:
- podsecuritypolicies
resourceNames: