kubetail
kubetail copied to clipboard
Set context before calculating default namespace
With that change and a following kube config
- context
namespace: dev
name: dev
- context
namespace: prod
name: prod
all calls to kubetail below will work and yield the same result
kubetail --context prod
kubetail -n prod --context prod
kubetail --context prod -n prod
Thanks for the PR! However I find it a bit hacky to set the context like this. I think it should be possible to pass it as an argument to calculate_default_namespace
instead which would be nicer and include less mutable state (at least that what I hope). I'll see if I can come up with an alternative, but big thanks for the PR anyway! I'll let you know when/if I come up with an alternative and I would be super happy if you could try it out.
Hey @johanhaleby totally fair, wasn't happy with my solution either but couldn't come up with a cleaner way. I'll be in standby if you need me.