mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 20:57:32 +08:00
remove useless kube client in nacos v1 watcher (#788)
This commit is contained in:
@@ -26,9 +26,7 @@ import (
|
|||||||
"github.com/nacos-group/nacos-sdk-go/model"
|
"github.com/nacos-group/nacos-sdk-go/model"
|
||||||
"github.com/nacos-group/nacos-sdk-go/vo"
|
"github.com/nacos-group/nacos-sdk-go/vo"
|
||||||
"istio.io/api/networking/v1alpha3"
|
"istio.io/api/networking/v1alpha3"
|
||||||
versionedclient "istio.io/client-go/pkg/clientset/versioned"
|
|
||||||
"istio.io/pkg/log"
|
"istio.io/pkg/log"
|
||||||
ctrl "sigs.k8s.io/controller-runtime"
|
|
||||||
|
|
||||||
apiv1 "github.com/alibaba/higress/api/networking/v1"
|
apiv1 "github.com/alibaba/higress/api/networking/v1"
|
||||||
"github.com/alibaba/higress/pkg/common"
|
"github.com/alibaba/higress/pkg/common"
|
||||||
@@ -61,7 +59,6 @@ type watcher struct {
|
|||||||
cache memory.Cache
|
cache memory.Cache
|
||||||
mutex *sync.Mutex
|
mutex *sync.Mutex
|
||||||
stop chan struct{}
|
stop chan struct{}
|
||||||
client *versionedclient.Clientset
|
|
||||||
isStop bool
|
isStop bool
|
||||||
updateCacheWhenEmpty bool
|
updateCacheWhenEmpty bool
|
||||||
authOption provider.AuthOption
|
authOption provider.AuthOption
|
||||||
@@ -79,18 +76,6 @@ func NewWatcher(cache memory.Cache, opts ...WatcherOption) (provider.Watcher, er
|
|||||||
stop: make(chan struct{}),
|
stop: make(chan struct{}),
|
||||||
}
|
}
|
||||||
|
|
||||||
config, err := ctrl.GetConfig()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
ic, err := versionedclient.NewForConfig(config)
|
|
||||||
if err != nil {
|
|
||||||
log.Errorf("can not new istio client, err:%v", err)
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
w.client = ic
|
|
||||||
|
|
||||||
w.NacosRefreshInterval = int64(DefaultRefreshInterval)
|
w.NacosRefreshInterval = int64(DefaultRefreshInterval)
|
||||||
|
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
|
|||||||
Reference in New Issue
Block a user