client
client copied to clipboard
Load config file from KUBECONFIG env
It would be great it the client would try to load a config defined in the KUBECONFIG env var.
At the moment only $HOME/.kube/config
is checked:
https://github.com/swiftkube/client/blob/4f278b291ae53870306c5346bbb5f5d2c5c3e563/Sources/SwiftkubeClient/Config/KubernetesClientConfig.swift#L207
Hi @MyIgel, I think this would make sense. I actually wrote this bit of code and I can give you some guidance here if you want to do a PR.
I think you should just make a new struct that implements the protocol KubernetesClientConfigLoader
and that way it'll fit in with all the others. I'm not sure modifying the existing behaviour is what you want to do. But you can check with @iabudiab
@MyIgel Yes, this is useful and should be easy to do
@thomashorrobin Exactly. I guess, the behaviour change is minimal and should be expected:
- first $HOME/.kube/config
- then KUBECONFIG env var
- then /var/run/secrets/kubernetes.io/serviceaccount