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

Add --context flag #214

Open
cykl opened this issue Sep 4, 2024 · 3 comments · May be fixed by #215
Open

Add --context flag #214

cykl opened this issue Sep 4, 2024 · 3 comments · May be fixed by #215
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@cykl
Copy link
Contributor

cykl commented Sep 4, 2024

Kafkactl currently supports multiple contexts. To use a context, one must use kubectl config use-context aws-dev.

This is often fine, but it also has following drawbacks:

  • Active context is not explicit in a command line. You must know the active context to asset what a command will do.
  • It's often annoying having to type two commands when one could suffice.

Have you ever thought about introducing a --context flag (similar to kubectl). An explicit --context would take precedence over anything else. People enjoying how it works today can continue to do so, and people who prefer to set the context with every command will be happy to.

@d-rk
Copy link
Collaborator

d-rk commented Sep 4, 2024

hey @cykl

I think its a good idea. Its not already there because I personally did not have such a use case, yet.
It should be fairly easy to implement. Starting point would be to add it to the global configs here:
https://github.com/deviceinsight/kafkactl/blob/main/cmd/root.go#L54

Regards,
Dirk

@d-rk d-rk added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Sep 4, 2024
@cykl
Copy link
Contributor Author

cykl commented Sep 4, 2024

Thanks for the feedback.

That's a good excuse to learn some go. I'll submit a PR.

@cykl cykl linked a pull request Sep 5, 2024 that will close this issue
5 tasks
@mzealey
Copy link

mzealey commented Sep 9, 2024

Yes really useful for us also. use-context requires having write permissions on the config file which we don't want to give.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants