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

Errors after modifying KUBECONFIG variable #2

Closed
pxtxs opened this issue Feb 12, 2020 · 1 comment · Fixed by #3
Closed

Errors after modifying KUBECONFIG variable #2

pxtxs opened this issue Feb 12, 2020 · 1 comment · Fixed by #3

Comments

@pxtxs
Copy link
Contributor

pxtxs commented Feb 12, 2020

Hi @sbstp ,
If KUBECONFIG variable become invalid, kubie isn't functioning anymore.

[13:08:30 ~ 0] >> pierre $ kubie ctx api-prod 
[api-prod|monitoring] [13:08:32 ~ 0] >> pierre $ export KUBECONFIG="/dev/null"
Error: EOF while parsing a value
Error: EOF while parsing a value
[|] [13:08:45 ~ 0] >> pierre $ 
Error: EOF while parsing a value
Error: EOF while parsing a value
[|] [13:08:48 ~ 0] >> pierre $ kubie ctx a
Error: Could not find context a
Error: EOF while parsing a value
Error: EOF while parsing a value
[|] [13:08:52 ~ 1] >> pierre $ kubie ctx api-prod
Error: EOF while parsing a value
Error: EOF while parsing a value
[|] [13:08:57 ~ 0] >> pierre $ 

We could use a KUBIE_KUBECONFIG variable to avoid this.
What do you think ?

Thanks,
Pierre

@sbstp
Copy link
Owner

sbstp commented Feb 13, 2020

Yeah that's a good idea. I think I can also do a hack which would make it impossible to break kubectl by playing with the KUBECONFIG variable. In the .bashrc I can generate a function that sets the variable every time like so:

function kubectl {
  KUBECONFIG=$KUBIE_KUBECONFIG kubectl "$@"
}

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 a pull request may close this issue.

2 participants