perm: Various fixes (values hash, revert)
The hash used by divingbell-perms to decide whether or not to rerun the permissions script was being generated incorrectly, using a fixed value instead of actually looking at the values passed to the chart. This change updates the hash to reflect conf.divingbell.perms, and will rerun the script if the hash changes. Also fixes the logic to revert permissions. Change-Id: I74f056f69a1b7f0eb9223915b1671e1e18091483
This commit is contained in:
parent
c8eba1688c
commit
3007010064
@ -86,7 +86,7 @@ add_single_perm(){
|
|||||||
|
|
||||||
revert_perm(){
|
revert_perm(){
|
||||||
# Revert
|
# Revert
|
||||||
prev_files="$(find "${backup_path}" -type f ! -name last_run_timestamp)"
|
prev_files="$(find "${backup_path}" -maxdepth 1 -type f)"
|
||||||
if [ -n "${prev_files}" ]; then
|
if [ -n "${prev_files}" ]; then
|
||||||
basename -a ${prev_files} | sort > /tmp/prev_perm
|
basename -a ${prev_files} | sort > /tmp/prev_perm
|
||||||
echo "${applied_perm}" | sort > /tmp/curr_perm
|
echo "${applied_perm}" | sort > /tmp/curr_perm
|
||||||
@ -146,8 +146,7 @@ revert_perm(){
|
|||||||
|
|
||||||
cd "${backup_path}"
|
cd "${backup_path}"
|
||||||
|
|
||||||
{{- $_ := set $.Values "__values_hash" list }}
|
{{- $hash := $.Values.conf.perm | toString | sha256sum }}
|
||||||
{{- $hash := $.Values.__values_hash | toString | sha256sum }}
|
|
||||||
|
|
||||||
hash={{ $hash | squote }}
|
hash={{ $hash | squote }}
|
||||||
if [ ! -d "${hash}" ]; then
|
if [ ! -d "${hash}" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user