helm-nexus-push icon indicating copy to clipboard operation
helm-nexus-push copied to clipboard

Unable to use the plugin due to unbound variable

Open pamiel opened this issue 6 years ago • 3 comments

  • What are you trying to do? Install the plugin and login to my Nexus repo. When running helm nexus-push my-repo login -u user, I receive an error /root/.helm/plugins/helm-nexus-push/push.sh: line 90: PASSWORD: unbound variable

  • What feature or behavior is this required for? login to the Nexus repo using the plugin

  • How could we solve this issue? (Not knowing is okay!) It looks to be due to the declaration of the PASSWORD variable: declare PASSWORD (https://github.com/sonatype-nexus-community/helm-nexus-push/blob/master/push.sh#L24) The issue is solved (workarounded ?) by adding an ending = to the declaration, ensuring that the PASSWORD variable is "set" before being acessed in line 90 of the script. For safety, I added the same ending = for lines 23 (USERNAME variable). Strangely, nothing bad happens for the similar declarations of variables CMD, AUTH, and CHART that I did not touched.

  • Anything else?

pamiel avatar Feb 12 '19 16:02 pamiel

Same error. Can not push in anonymous mode If I push by specifying a user and a passord helm nexus-push nexus mychart-0.2.1.tgz -u admin -p secret I got another similar error : .helm/plugins/helm-nexus-push.git/push.sh: line 126: AUTH: unbound variable

fredgate avatar Nov 08 '19 14:11 fredgate

Hi,

Same error. My workaround is to set --password "". Not very clean but I can use login cmd to hide password

helm nexus-push nexus mychart-0.2.1.tgz --password ""

RaphC avatar Nov 03 '20 13:11 RaphC

Same here. I was trying to use my user/pwd declared with helm nexus-push login (neat !)

Script is failing due to the "-u" option specified with set -ueo pipefail when some undefined variables are tested.

Fixed it like by editing push.sh On MacOS, `vi ~/Library/helm/plugins/helm-nexus-push.git/push.sh``

Changed this:

declare USERNAME
declare PASSWORD

with this

declare USERNAME=""
declare PASSWORD=""

in order to provide default values.

vce-xx avatar Dec 17 '20 10:12 vce-xx