Skip to content

Commit

Permalink
Fix pkg/config to use standard kubeconfig machinery (#2133)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
miquella and mergify[bot] committed Jun 23, 2023
1 parent cedfed3 commit fa7beb3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/config/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"gopkg.in/check.v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
)

const (
Expand Down Expand Up @@ -47,7 +47,12 @@ func GetEnvOrSkip(c *check.C, varName string) string {

// due to cycle imports issues pks/kube can not be used
func newKubeClient() (kubernetes.Interface, error) {
c, err := rest.InClusterConfig()
cc := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
clientcmd.NewDefaultClientConfigLoadingRules(),
&clientcmd.ConfigOverrides{},
)

c, err := cc.ClientConfig()
if err != nil {
return nil, err
}
Expand Down

0 comments on commit fa7beb3

Please sign in to comment.