'helm secrets update' does not work with Centos7/bash4
Using centos7 and bash 4 I receive the following error when trying to run helm secrets update
/root/.helm/plugins/helm-secrets/secrets.sh: line 262: local: -n: invalid option
local: usage: local [option] name[=value]
I was able to fix this by changing secrets.sh: line 265 from:
if [[ ${BASH_VERSINFO[0]} -lt 4 ]]
to:
if [[ ${BASH_VERSINFO[0]} -lt 5 ]]
so now the script is using the eval commands per the comment on line 250:
# Name references ("declare -n" and "local -n") are a Bash 4 feature.
# For previous versions, work around using eval.
I ran into the same issue on a CentOS 7 machine. If you run echo $BASH_VERSINFO on a CentOS 7 machine, it shows 4.
There are 2 sections in secrets.sh where it checks for ${BASH_VERSINFO}. I changed lines 255 AND lines 283 to -lt 5, and it works. You can't just change line 255
See #73
@ianau74 I think for my purposes I only needed to change that line but It totally makes sense to have to change both. @mhyllander - copy that