Skip to content

Commit

Permalink
[bitcoin-core] check perms before setting them
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieC3 committed Sep 29, 2022
1 parent 6d270d8 commit e66816e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hirosystems/bitcoin-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ sources:
- https://github.com/bitcoin/bitcoin
- https://github.com/ruimarinho/docker-bitcoin-core
- https://bitcoin.org
version: 1.1.3
version: 1.1.4
6 changes: 3 additions & 3 deletions hirosystems/bitcoin-core/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ spec:
wget ${ARCHIVE_URL} -O ${DATA_DIR}/archive.tar.gz
tar zxvf ${DATA_DIR}/archive.tar.gz -C ${DATA_DIR}
rm -f ${DATA_DIR}/archive.tar.gz
echo "Setting permissions"
chown -R {{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }} ${DATA_DIR}
else
echo "Previous data found. Exiting."
fi
Expand All @@ -111,7 +109,9 @@ spec:
- /bin/bash
- -ec
- |
chown -R {{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }} {{ .Values.persistence.mountPath }}
if [[ "$(stat {{ .Values.persistence.mountPath }} -c %u:%g)" != "{{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }}" ]]; then
chown -R {{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }} {{ .Values.persistence.mountPath }}
fi
{{- if .Values.volumePermissions.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.volumePermissions.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
Expand Down

0 comments on commit e66816e

Please sign in to comment.