guessi / kubectl-grep

Filter Kubernetes resources by matching their names
Apache License 2.0
114 stars 8 forks source link

Feature: construct kube config using client-go #14

Closed tsaarni closed 5 years ago

tsaarni commented 5 years ago

Adds support for setting config path with KUBECONFIG

Currently kubectl-grep does not obey KUBECONFIG environment variable:

$ export KUBECONFIG=myconfig
$ kubectl grep pod 
Fatal: Unable to open /home/tsaarni/.kube/config

Expected behavior is to use config pointed by KUBECONFIG environment variable.

This PR constructs config by using NewDefaultClientConfigLoadingRules() from client-go, which has expected behavior.

guessi commented 5 years ago

@tsaarni thanks~