Skip to content

Commit

Permalink
applying suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
rockb1017 committed Nov 19, 2021
1 parent db72401 commit 38e0474
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions helm-charts/splunk-otel-collector/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ spec:
mountPath: /var/log
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
{{- if $agent.runInitForNonRoot }}
{{- if $agent.securityContext }}
{{- if not (eq (toString $agent.securityContext.runAsUser) "0" ) }}
- name: chown
image: registry.access.redhat.com/ubi8/ubi
command: ['sh', '-c', '
Expand Down Expand Up @@ -178,6 +179,7 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
containers:
{{- if and (eq (include "splunk-otel-collector.logsEnabled" .) "true") (eq .Values.logsEngine "fluentd") }}
Expand Down Expand Up @@ -247,12 +249,10 @@ spec:
imagePullPolicy: {{ .Values.image.otelcol.pullPolicy }}
{{- if or $agent.securityContext (and (eq (include "splunk-otel-collector.logsEnabled" $) "true") (eq .Values.logsEngine "otel")) }}
securityContext:
{{- if not $agent.runInitForNonRoot }}
runAsUser: 0
{{- else }}
{{- if $agent.securityContext }}
{{ toYaml $agent.securityContext | nindent 10 }}
{{- end }}
{{- toYaml $agent.securityContext | nindent 10 }}
{{- else }}
runAsUser: 0
{{- end }}
{{- end }}
env:
Expand Down
3 changes: 2 additions & 1 deletion helm-charts/splunk-otel-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ agent:

# To collect container logs and journald logs, it will run the agent as a root user.
# To run it as non root user, uncomment below `securityContext` options.
securityContext: {}

# securityContext:
# runAsUser: 20000
# runAsGroup: 20000

Expand Down

0 comments on commit 38e0474

Please sign in to comment.