Skip to content

Set context before calculating default namespace #110

Open
andreacab wants to merge 1 commit intojohanhaleby:masterfrom
andreacab:master
Open

Set context before calculating default namespace #110
andreacab wants to merge 1 commit intojohanhaleby:masterfrom
andreacab:master

Conversation

@andreacab
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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