1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge pull request #615 from ibaum/fix-kubernetes-client

Update kubernetes client to connect to various kubernetes providers
This commit is contained in:
Chris Cummer
2019-09-11 10:39:36 -07:00
committed by GitHub
3 changed files with 8 additions and 3 deletions

View File

@@ -4,6 +4,8 @@ import (
"sync"
"k8s.io/client-go/kubernetes"
// Includes authentication modules for various Kubernetes providers
_ "k8s.io/client-go/plugin/pkg/client/auth"
"k8s.io/client-go/tools/clientcmd"
)
@@ -30,11 +32,11 @@ func (widget *Widget) getInstance() *clientInstance {
func (widget *Widget) getKubeClient() kubernetes.Interface {
config, err := clientcmd.BuildConfigFromFlags("", widget.kubeconfig)
if err != nil {
panic(err.Error)
panic(err)
}
clientset, err := kubernetes.NewForConfig(config)
if err != nil {
panic(err.Error)
panic(err)
}
return clientset
}