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

Unbound variable error for helm cli #551

Closed
3 tasks done
pratik136 opened this issue Jul 4, 2021 · 2 comments
Closed
3 tasks done

Unbound variable error for helm cli #551

pratik136 opened this issue Jul 4, 2021 · 2 comments

Comments

@pratik136
Copy link

pratik136 commented Jul 4, 2021

Describe the bug

Pressing tab when using the helm cli cancels the command with the message "BASH_COMP_DEBUG_FILE: unbound variable"

To reproduce

  1. Install the helm cli
  2. Type 'helm i tab'
  3. See problem

Expected behavior

Ideally we would expect the 'i' to expand to 'install'. Alternatively, the completion tab could simply be ignored.

Versions (please complete the following information)

  • Operating system name/distribution and version: Alpine Linux v3.14 running as a container
  • bash version, echo "$BASH_VERSION": 5.1.4(1)-release
  • bash-completion version, (IFS=.; echo "${BASH_COMPLETION_VERSINFO[*]}"): 2.11

Debug trace

bash-completions-error-debug-dump.txt

@akinomyoga
Copy link
Collaborator

I cannot find any string BASH_COMP_DEBUG_FILE in the bash-completion repository. This is the issue in the completion scripts generated by helm. The completion script of helm seems to be generated by the command helm completion bash. The problematic completion code seems to be emitted by GenBashCompletion called at cmd/helm/completion.go L132 (helm/helm). The function GenBashCompletion seems to be defined in a golang library, spf13/cobra. The culprit is bash_completions.go L27 (spf13/cobra).

Since this is the problem of the completion script generator spf13/cobra, there are so many affected scripts.

@scop
Copy link
Owner

scop commented Jul 5, 2021

Yeah, this is a long standing issue with cobra, and PR's such as spf13/cobra#1321 have unfortunately been stuck waiting for a longish time. But I'm afraid there's nothing we can do about it here, a workaround is to turn nounset mode off.

@scop scop closed this as completed Jul 5, 2021
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

3 participants