deviceinsight / kafkactl

Command Line Tool for managing Apache Kafka
https://deviceinsight.github.io/kafkactl/
Apache License 2.0
816 stars 79 forks source link

Add --context flag #214

Open cykl opened 3 weeks ago

cykl commented 3 weeks ago

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:

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 commented 3 weeks ago

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

cykl commented 3 weeks ago

Thanks for the feedback.

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

mzealey commented 2 weeks ago

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