Skip to content

Commit

Permalink
Fix tests after tricky cherry-picks
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhoherd committed Feb 6, 2024
1 parent 0abc690 commit 303ea25
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
8 changes: 8 additions & 0 deletions charts/kibana/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,11 @@ imagePullSecrets:
- name: {{ .Values.global.privateRegistry.secretName }}
{{- end -}}
{{- end -}}

{{- define "kibana.securityContext" -}}
{{- if or (eq ( toString ( .Values.securityContext.runAsUser )) "auto") ( .Values.global.openshiftEnabled ) }}
{{- omit .Values.securityContext "runAsUser" | toYaml | nindent 12 }}
{{- else }}
{{- .Values.securityContext | toYaml | nindent 12 }}
{{- end -}}
{{- end }}
8 changes: 8 additions & 0 deletions charts/prometheus/templates/_helpers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,11 @@ imagePullSecrets:
- name: {{ .Values.global.privateRegistry.secretName }}
{{- end -}}
{{- end -}}

{{- define "prometheus.securityContext" -}}
{{- if or (eq ( toString ( .Values.securityContext.runAsUser )) "auto") ( .Values.global.openshiftEnabled ) }}
{{- omit .Values.securityContext "runAsUser" | toYaml | nindent 12 }}
{{- else }}
{{- .Values.securityContext | toYaml | nindent 12 }}
{{- end -}}
{{- end }}
4 changes: 2 additions & 2 deletions charts/prometheus/templates/prometheus-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ spec:
- --volume-dir=/etc/prometheus/config
image: {{ include "configReloader.image" . }}
imagePullPolicy: {{ .Values.images.prometheus.pullPolicy }}
securityContext: {{ toYaml .Values.securityContext| nindent 12 }}
securityContext: {{ template "prometheus.securityContext" . }}
resources:
{{ toYaml .Values.configMapReloader.resources | indent 12 }}
volumeMounts:
Expand All @@ -94,7 +94,7 @@ spec:

- name: prometheus
image: {{ include "prometheus.image" . }}
securityContext: {{ toYaml .Values.securityContext| nindent 12 }}
securityContext: {{ template "prometheus.securityContext" . }}
imagePullPolicy: {{ .Values.images.prometheus.pullPolicy }}
resources: {{ toYaml .Values.resources | nindent 12 }}
args:
Expand Down

0 comments on commit 303ea25

Please sign in to comment.