habitat-sh / habitat-operator

A Kubernetes operator for Habitat services
Apache License 2.0
61 stars 17 forks source link

default kubeconfig for `habitat-operator` #328

Open surajssd opened 6 years ago

surajssd commented 6 years ago

If no --kubeconfig flag is provided default to the kubeconfig in $HOME/.kube/config.

krnowak commented 6 years ago

Hm, not sure about it. If no --kubeconfig is passed then we are trying to use some special in-cluster config. See https://github.com/habitat-sh/habitat-operator/blob/master/vendor/k8s.io/client-go/tools/clientcmd/client_config.go#L526-L543.

surajssd commented 6 years ago

such a fallback logic can be implemented, since we intend to use this as a cmd line and incluster both. Like first look at the flag, if not provided see if $HOME/.kube/config if not then create inclusterconfig.