From f46d180ca8250927786c80e0170638a29e134f5a Mon Sep 17 00:00:00 2001 From: GreatLazyMan Date: Fri, 12 Jan 2024 14:58:28 +0800 Subject: [PATCH] title: fix cni compatibility issue, cluster with calico can't create ippool to avoid masq description: When host cluster use calico as cni, member cluster use flannel, host cluster can't create ippool for member cluster pod cidr to avoid masq, because when host cluster can't excute code after `cluster.Spec.ClusterLinkOptions.CNI != utils.CNITypeCalico` to get `cluster.Status.ClusterLinkStatus.PodCIDRs` from member cluster Signed-off-by: GreatLazyMan --- .../controllers/calicoippool/calicoippool_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/clusterlink/controllers/calicoippool/calicoippool_controller.go b/pkg/clusterlink/controllers/calicoippool/calicoippool_controller.go index ba409c794..72f40c749 100644 --- a/pkg/clusterlink/controllers/calicoippool/calicoippool_controller.go +++ b/pkg/clusterlink/controllers/calicoippool/calicoippool_controller.go @@ -339,7 +339,7 @@ func (c *Controller) Reconcile(key utils.QueueKey) error { } klog.Infof("start reconcile cluster %s", cluster.Name) - if cluster.Spec.ClusterLinkOptions.CNI != utils.CNITypeCalico { + if cluster.Name == c.clusterName && cluster.Spec.ClusterLinkOptions.CNI != utils.CNITypeCalico { klog.Infof("cluster %s cni type is %s skip reconcile", cluster.Name, cluster.Spec.ClusterLinkOptions.CNI) return nil }