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

Set context before calculating default namespace #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andreacab
Copy link

@andreacab andreacab commented Dec 10, 2019

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

@johanhaleby
Copy link
Owner

johanhaleby commented Dec 11, 2019

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.

@andreacab
Copy link
Author

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.

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

Successfully merging this pull request may close these issues.

2 participants