From 749c2f738309b46b5243c12f8d8520a3c4656b76 Mon Sep 17 00:00:00 2001 From: wuyingjun Date: Thu, 23 Nov 2023 10:41:58 +0800 Subject: [PATCH] modify flannel config informer options to avoid the situation when the namespace is custom Signed-off-by: wuyingjun --- pkg/clusterlink/controllers/cluster/cluster_controller.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/clusterlink/controllers/cluster/cluster_controller.go b/pkg/clusterlink/controllers/cluster/cluster_controller.go index 89eed5c1e..a99fdcde7 100644 --- a/pkg/clusterlink/controllers/cluster/cluster_controller.go +++ b/pkg/clusterlink/controllers/cluster/cluster_controller.go @@ -39,7 +39,6 @@ import ( // KubeFlannelNetworkConfig const ( FlannelCNI = "flannel" - KubeFlannelNamespace = "kube-flannel" KubeFlannelConfigMap = "kube-flannel-cfg" KubeFlannelNetworkConf = "net-conf.json" KubeFlannelIPPool = "Network" @@ -371,7 +370,7 @@ func (c *Controller) initCalicoWatcherWithEtcdBackend(ctx context.Context, clust // todo by wuyingjun-lucky func (c *Controller) initFlannelInformer(context context.Context, cluster *clusterlinkv1alpha1.Cluster, kubeClient kubernetes.Interface) (SetClusterPodCIDRFun, error) { - informerFactory := informers.NewSharedInformerFactoryWithOptions(kubeClient, 0, informers.WithNamespace(KubeFlannelNamespace)) + informerFactory := informers.NewSharedInformerFactory(kubeClient, 0) lister := informerFactory.Core().V1().ConfigMaps().Lister() _, err := informerFactory.Core().V1().ConfigMaps().Informer().AddEventHandler( cache.ResourceEventHandlerFuncs{