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

Error: flags cannot be placed before plugin name: --context when context name has spaces in it #78

Open
mogorman opened this issue Mar 3, 2022 · 4 comments

Comments

@mogorman
Copy link
Contributor

mogorman commented Mar 3, 2022

i can work around by wrapping the context name in single quotes but would be nice if it just did it

@abrochard
Copy link
Owner

Just to be clear, you are seeing the error message "flags cannot be placed before plugin name: --context" whenever you work in a context that has spaces in its name? like kubectl --context "my context" get pods would be an equivalent command?

@mogorman
Copy link
Contributor Author

mogorman commented Mar 3, 2022

so my contexts are named
aws eks staging env

when it tries to run it it runs it as kubectl --contex aws eks staging env --context which fails it needs to be quoted. given emacs could detect spaces seems like we could wrap it so that the kubectl commands are excecuted correctly.

I worked around it by just renaming my context to single word names, but these configs arent managed by me so will have to do this each time they are updated.

@abrochard
Copy link
Owner

I see. Thanks for bringing that up. This would require a bit of work and some testing, especially since one would have to have a context with spaces to verify. I imagine the bulk of the work would have to be around the kubel-set-context function.

In the meantime, yes renaming context to have no spaces is a good workaround.

Also I understand you do not manage the cluster, but I have to admit that having spaces in context is extremely odd and not recommended in general.

@mogorman
Copy link
Contributor Author

mogorman commented Mar 4, 2022

ya no disagreement there. spaces_are_bad_in_general.

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

2 participants