From 66f4846665bc9a1792935e75df6c1fdd0243079b Mon Sep 17 00:00:00 2001 From: Kris Moore Date: Sat, 23 Jan 2021 18:24:15 -0500 Subject: [PATCH] Small performance improvement. No need to chown the entire directory after the first init. --- charts/ipfs/1.0.0/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/ipfs/1.0.0/templates/deployment.yaml b/charts/ipfs/1.0.0/templates/deployment.yaml index 78db80cf12..fed49db153 100644 --- a/charts/ipfs/1.0.0/templates/deployment.yaml +++ b/charts/ipfs/1.0.0/templates/deployment.yaml @@ -26,7 +26,7 @@ spec: initContainers: - name: init-init image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - command: ['/bin/sh', '-c', '[ ! -e /data/ipfs/config ] && /usr/local/bin/ipfs init ; exit 0'] + command: ['/bin/sh', '-c', '[ ! -e /data/ipfs/config ] && (/usr/local/bin/ipfs init ; chown -R 1000:100 /data/ipfs) ; exit 0'] imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: data @@ -80,7 +80,7 @@ spec: mountPath: /export - name: init-chown image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - command: ['chown', '-R', '1000:100', '/data/ipfs'] + command: ['chown', '1000:100', '/data/ipfs/config'] imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: data