SimonTheLeg / konf-go

konf is a lightweight kubeconfig manager. With konf you can use different kubeconfigs at the same time. And because it does not need subshells, konf is blazing fast!
Apache License 2.0
168 stars 12 forks source link

Context changes (namespace) should be commited to store files #53

Open blut opened 9 months ago

blut commented 9 months ago

Whenever I change context, the currently selected namespace is reset to the value set on import.

Ideally, the namespace would be updated in the store, so that later switches to the same context will continue in the same namespace.

This seems challenging, since we would have to commit changes to the store from a call to the current context. Maybe this would not be interesting for everyone, so maybe make it a flag to konf namespace?

blut commented 9 months ago

I think someone added a TODO in the namespace command: image

Would you prefer to store this similarly to the latestkonf ?

SimonTheLeg commented 9 months ago

Hi, thanks for opening this issue. Back in the day, I came to the conclusion that it is something that every user has different preferences on. Therefore I wanted to make this configurable. However currently there is no good config mechanism in place for konf itself (apart from some global flags that you can alias).

Your issue brought up a couple of good points and I am now planning to build a config mechanism into konf and work on this topic next. Thanks for suggesting this!

blut commented 9 months ago

If I remember correctly, Cobra should have a type of config / store. However, I don't think this will solve my issue with saving my configuration per context / config