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

The "source <(kapp completion bash)" command outputs an error message #447

Closed
itaytalmi opened this issue Feb 27, 2022 · 3 comments
Closed
Assignees
Labels
bug This issue describes a defect or unexpected behavior carvel accepted This issue should be considered for future work and that the triage process has been completed

Comments

@itaytalmi
Copy link

itaytalmi commented Feb 27, 2022

What steps did you take:
[A clear and concise description steps and any files that can be used to reproduce the problem.]

Added source <(kapp completion bash) to my /etc/profile so it would automatically load.

To reproduce the issue, you can simply run source <(kapp completion bash).

What happened:
[A small description of the result]

Got the following error message:

Succeeded: command not found

This is because the kapp completion bash commands outputs a Succeeded string at the end, which is not a valid command, and when used with source, bash tries to execute it.

Bash completion does work, though.

What did you expect:
[A description of what was expected]

Anything else you would like to add:
[Additional information that will assist in solving the issue.]

As a workaround, I'm using the following:

source <(kapp completion bash | grep -v Succeeded)

This removes the Succeeded string from the output, so the error doesn't occur.

Same issue also occurs with imgpkg, as I described here:
carvel-dev/imgpkg#342

This issue doesn't occur with ytt, because ytt completion bash doesn't output the Succeeded string.

Environment:

  • kapp version (use kapp --version): 0.46.0
  • OS (e.g. from /etc/os-release): Using Linux Ubuntu 20.04.4 LTS (Focal Fossa) and macOS Monterey 12.2.1, but this issue occurs on any bash.
  • Kubernetes version (use kubectl version): Irrelevant

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@itaytalmi itaytalmi added bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been reviewed for validity labels Feb 27, 2022
@renuy
Copy link
Contributor

renuy commented Feb 28, 2022

Thanks @itaytalmi for bringing this up. Adding it to our un-prioritised backlog for now.
We would be happy to prioritise a review, if you want submit a PR for the same.

@renuy renuy added carvel accepted This issue should be considered for future work and that the triage process has been completed and removed carvel triage This issue has not yet been reviewed for validity labels Feb 28, 2022
@rohitagg2020
Copy link
Contributor

Hi @itaytalmi

kapp sets --tty=true by default which results in the extra "Succeeded" at the end of the file.

We have added a fix in the develop branch. To avoid printing extra "Succeeded" in the end, add --tty=false flag to the kapp command. e.g. source <(kapp completion bash --tty=false).

This fix will be available from the next kapp release i.e. >=0.47.0.
Once, a next kapp release is made, we will come and update the issue.

@rohitagg2020 rohitagg2020 self-assigned this Mar 24, 2022
@renuy
Copy link
Contributor

renuy commented May 5, 2022

Fix available as part of kapp v0.47.0

@github-actions github-actions bot added the carvel triage This issue has not yet been reviewed for validity label May 5, 2022
@praveenrewar praveenrewar removed the carvel triage This issue has not yet been reviewed for validity label May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior carvel accepted This issue should be considered for future work and that the triage process has been completed
Projects
None yet
Development

No branches or pull requests

4 participants