Commit 289bb34e authored by GLYASAI's avatar GLYASAI
Browse files

[Fix] fix bug: unable to proxy kubeapi

parent 149fded1
Showing with 12 additions and 4 deletions
+12 -4
......@@ -78,15 +78,15 @@ type GWController struct {
// Start starts Gateway
func (gwc *GWController) Start(errCh chan error) error {
if gwc.ocfg.EnableRbdEndpoints {
go gwc.initRbdEndpoints(errCh)
}
// start plugin(eg: nginx, zeus and etc)
gwc.GWS.Start(errCh)
// start informer
gwc.store.Run(gwc.stopCh)
if gwc.ocfg.EnableRbdEndpoints {
go gwc.initRbdEndpoints(errCh)
}
// start task queue
go gwc.syncQueue.Run(1*time.Second, gwc.stopCh)
......
......@@ -4,8 +4,10 @@ import (
"github.com/Sirupsen/logrus"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/apimachinery/pkg/apis/meta/v1"
)
// NewClientSet returns a new kubernetes clientSet
func NewClientSet(kubeconfig string) (*kubernetes.Clientset, error) {
conf, err := clientcmd.BuildConfigFromFlags("", kubeconfig)
if err != nil {
......@@ -17,6 +19,12 @@ func NewClientSet(kubeconfig string) (*kubernetes.Clientset, error) {
if err != nil {
return nil, err
}
_, err = clientSet.CoreV1().Namespaces().List(v1.ListOptions{})
if err != nil {
return nil, err
}
logrus.Debug("Kube client api create success.")
return clientSet, nil
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment