From 14e65cc8d1930537e0e64be2ac265eefd86d01ed Mon Sep 17 00:00:00 2001 From: aerotog Date: Thu, 6 Jun 2019 02:46:11 -0500 Subject: [PATCH] [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 --- stable/postgresql/Chart.yaml | 2 +- stable/postgresql/templates/statefulset-slaves.yaml | 3 ++- stable/postgresql/templates/statefulset.yaml | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/stable/postgresql/Chart.yaml b/stable/postgresql/Chart.yaml index fd26dd2b4f..94a647374b 100644 --- a/stable/postgresql/Chart.yaml +++ b/stable/postgresql/Chart.yaml @@ -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: diff --git a/stable/postgresql/templates/statefulset-slaves.yaml b/stable/postgresql/templates/statefulset-slaves.yaml index 9cae39425f..81bb2c6aa6 100644 --- a/stable/postgresql/templates/statefulset-slaves.yaml +++ b/stable/postgresql/templates/statefulset-slaves.yaml @@ -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: diff --git a/stable/postgresql/templates/statefulset.yaml b/stable/postgresql/templates/statefulset.yaml index 0b6003a4c1..b176079c24 100644 --- a/stable/postgresql/templates/statefulset.yaml +++ b/stable/postgresql/templates/statefulset.yaml @@ -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: