Skip to content

Commit

Permalink
[stacks-blockchain] 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 e66816e commit 65b6326
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions hirosystems/stacks-blockchain/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: bitcoin-core
repository: https://charts.hiro.so/hirosystems
version: 1.1.3
version: 1.1.4
- name: common
repository: https://charts.bitnami.com/bitnami
version: 1.17.1
digest: sha256:7f7c5df57b72f4d15694aa5558f4f6c7d162cc9477ed715cc3a608e5ca40fc64
generated: "2022-09-28T15:23:46.357345-04:00"
digest: sha256:37e8ba95b0232bac8d0ffe9e28038c23b589b7b96cd317a5eb0460f26ce7782c
generated: "2022-09-28T21:10:59.24842-04:00"
2 changes: 1 addition & 1 deletion hirosystems/stacks-blockchain/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ name: stacks-blockchain
sources:
- https://github.com/stacks-network/stacks-blockchain
- https://docs.stacks.co/
version: 1.1.4
version: 1.1.5
6 changes: 3 additions & 3 deletions hirosystems/stacks-blockchain/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 65b6326

Please sign in to comment.