[stable/postgresql] Fix data permission error on pod restart (#14538) (#14540)

The command 'mkdir -p' has no effect if the directory already exists. To ensure the init container sets the mode for an existing data directory, we call 'chmod 700' separately.

Signed-off-by: Tim Guenthner <aerotog@gmail.com>
This commit is contained in:
aerotog
2019-06-06 00:46:11 -07:00
committed by Kubernetes Prow Robot
parent 85f0163f47
commit 14e65cc8d1
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: postgresql
version: 5.3.2
version: 5.3.3
appVersion: 11.3.0
description: Chart for PostgreSQL, an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance.
keywords:
@@ -70,7 +70,8 @@ spec:
- sh
- -c
- |
mkdir -m 700 -p {{ .Values.persistence.mountPath }}/data
mkdir -p {{ .Values.persistence.mountPath }}/data
chmod 700 {{ .Values.persistence.mountPath }}/data
find {{ .Values.persistence.mountPath }} -mindepth 1 -maxdepth 1 -not -name ".snapshot" | \
xargs chown -R {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }}
securityContext:
+2 -1
View File
@@ -74,7 +74,8 @@ spec:
- sh
- -c
- |
mkdir -m 700 -p {{ .Values.persistence.mountPath }}/data
mkdir -p {{ .Values.persistence.mountPath }}/data
chmod 700 {{ .Values.persistence.mountPath }}/data
find {{ .Values.persistence.mountPath }} -mindepth 1 -maxdepth 1 -not -name ".snapshot" | \
xargs chown -R {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }}
securityContext: