Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use the plugin due to unbound variable #3

Open
pamiel opened this issue Feb 12, 2019 · 3 comments
Open

Unable to use the plugin due to unbound variable #3

pamiel opened this issue Feb 12, 2019 · 3 comments

Comments

@pamiel
Copy link

pamiel commented Feb 12, 2019

  • 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?

@fredgate
Copy link

fredgate commented Nov 8, 2019

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

@RaphC
Copy link

RaphC commented Nov 3, 2020

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 ""

@vce-xx
Copy link

vce-xx commented Dec 17, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants