helm-secrets icon indicating copy to clipboard operation
helm-secrets copied to clipboard

'helm secrets update' does not work with Centos7/bash4

Open rdelpret opened this issue 7 years ago • 3 comments

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.

rdelpret avatar Nov 16 '18 21:11 rdelpret

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

ianau74 avatar Jan 15 '19 22:01 ianau74

See #73

mhyllander avatar Jan 22 '19 09:01 mhyllander

@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

rdelpret avatar Jan 22 '19 16:01 rdelpret