Fix for #118: Properly indent securityContext

This commit is contained in:
Bojan Čekrlić 2023-02-09 09:02:28 +01:00
parent fc7ed0b391
commit 3eac3f42ae
3 changed files with 18 additions and 2 deletions

View file

@ -62,7 +62,7 @@ spec:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext: {{- toYaml .Values.container.postfix.securityContext | indent 12 }} securityContext: {{- toYaml .Values.container.postfix.securityContext | nindent 12 }}
ports: ports:
- name: smtp - name: smtp
containerPort: 587 containerPort: 587

View file

@ -0,0 +1,10 @@
container:
postfix:
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsUser: 1000
seccompProfile:
type: RuntimeDefault

View file

@ -2,7 +2,13 @@
set -e set -e
mkdir -p fixtures mkdir -p fixtures
for i in `find -maxdepth 1 -type f -name test\*yml | sort`; do FIND="find"
# Brew installs GNU find as "gfind" by default
if command -v gfind >/dev/null 2>&2; then
FIND="$(which gfind)"
fi
for i in `${FIND} -maxdepth 1 -type f -name test\*yml | sort`; do
echo "☆☆☆☆☆☆☆☆☆☆ $i ☆☆☆☆☆☆☆☆☆☆" echo "☆☆☆☆☆☆☆☆☆☆ $i ☆☆☆☆☆☆☆☆☆☆"
helm template -f $i --dry-run mail > fixtures/demo.yaml helm template -f $i --dry-run mail > fixtures/demo.yaml
docker run -it -v `pwd`/fixtures:/fixtures garethr/kubeval fixtures/demo.yaml docker run -it -v `pwd`/fixtures:/fixtures garethr/kubeval fixtures/demo.yaml