Skip to content

Commit

Permalink
fixes according to suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Kirill Thirteen <kirill_peretrukhin@epam.com>
  • Loading branch information
Kirill Thirteen committed Jun 27, 2023
1 parent 9609612 commit d7388ae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/fluent-bit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ maintainers:
annotations:
artifacthub.io/changes: |
- kind: added
description: "Add ability to use existing SecurityContextConstraints in OpenShift, for the fluent-bit chart."
description: "Added support for using an existing SecurityContextConstraints for OpenShift."
10 changes: 5 additions & 5 deletions charts/fluent-bit/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ autoscaling/v2
{{/*
Create the name of OpenShift SecurityContextConstraints to use
*/}}
{{- define "fluent-bit.openShift.securityContextConstraints.name" -}}
{{- if .Values.openShift.securityContextConstraints.create -}}
{{ default (include "fluent-bit.fullname" .) .Values.openShift.securityContextConstraints.name }}
{{- else if .Values.openShift.securityContextConstraints.existingName -}}
{{- printf "%s" .Values.openShift.securityContextConstraints.existingName -}}
{{- define "fluent-bit.openShiftSccName" -}}
{{- if not .Values.openShift.securityContextConstraints.create -}}
{{- printf "%s" .Values.openShift.securityContextConstraints.existingName -}}
{{- else -}}
{{- printf "%s" default (include "fluent-bit.fullname" .) .Values.openShift.securityContextConstraints.name -}}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/fluent-bit/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ rules:
resources:
- securitycontextconstraints
resourceNames:
- {{ include "fluent-bit.openShift.securityContextConstraints.name" . }}
- {{ include "fluent-bit.openShiftSccName" . }}
verbs:
- use
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/fluent-bit/templates/scc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: {{ include "fluent-bit.openShift.securityContextConstraints.name" . }}
name: {{ include "fluent-bit.openShiftSccName" . }}
labels:
{{- include "fluent-bit.labels" . | nindent 4 }}
{{- with .Values.openShift.securityContextConstraints.annotations }}
Expand Down

0 comments on commit d7388ae

Please sign in to comment.