-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
zsh autocomplete error when calling eksctl create nodegroup - invalid option definition #2747
Comments
Created a docker image for testing this issue Script
Output |
@michaelbeaumont @ysam12345 will the new release of spf13/cobra v1.10 help with this - spf13/cobra#1070 |
@michaelbeaumont @neha-viswanathan Yes, I think this is work. |
@ysam12345 a PR would be very welcome! |
Thanks @michaelbeaumont , I have created a pull request for this issue. |
Hello @michaelbeaumont,
A ysam12345:fix_zsh_completion_and_redirect_stdErr_to_stdOutI changed string "out", returned by "execute" function in test, to contain error message from stdErr. B ysam12345:fix_zsh_completion_and_change_err_in_testI changed error "err", returned by "execute" function in test, to have error message from stdErr when error is occur and rewrite some test case from checking message in "out" to checking message in "err"(L75-L80). I also rewrite some test condition from Equal to ContainSubstring , because the message from stdErr will be single/multiple lines with newline at the end. Also some test case L35-R38 will fail to pass lint if changed the string in fmt.Errorf to end with \n, so I can't use Equal condition except to avoid using fmt.Errorf. I wonder which one is better idea? And any suggestion will be helpful. Thanks! |
I think B is good. However, these tests need desperately to be refactored. They don't actually test the real behavior of the CLI since they mock so much, see e.g. the expected error output here: When I print the contents of With In reality, I don't see any difference in what's being printed where when I actually run |
Yeah I see...... We won't see the content of I think maybe they should be rewrote to test for the actually output? Please let me know if i understand wrong. |
Yes exactly, they need to be rewritten but not for your PR! 🙂 |
Maybe I can help this in the future. 🙂 Thanks. |
@ysam12345 Yeah go ahead with plan b! |
What happened?
When I type
eksctl create nodegroup [TAB]
It shows following error
_arguments:comparguments:319: invalid option definition: --version[Kubernetes version (valid options: 1.14, 1.15, 1.16, 1.17) [for nodegroups "auto" and "latest" can be used to automatically inherit version from the control plane or force latest]]:
Tested on my two macbook pro / Amazon Linux 2 EC2 Instance and saw the same error.
What you expected to happen?
Showing the autocomplete choices without any error.
How to reproduce it?
https://eksctl.io/introduction/#zsh
eksctl create nodegroup [TAB]
Anything else we need to know?
I think it's similar to this issue:
clap-rs/clap#771
I can manually add escape character to ~/.zsh/completion/_eksctl line334
After that, it works fine
Versions
Logs
The text was updated successfully, but these errors were encountered: