From 44799ae68a40ac5fb75537a364bd35a2b0aa285d Mon Sep 17 00:00:00 2001 From: zryfish Date: Thu, 15 Oct 2020 17:11:05 +0800 Subject: [PATCH] skip reconcile cluster if not join federation (#3021) Signed-off-by: Jeff --- pkg/controller/cluster/cluster_controller.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/controller/cluster/cluster_controller.go b/pkg/controller/cluster/cluster_controller.go index fe315df01..0a5377b9b 100644 --- a/pkg/controller/cluster/cluster_controller.go +++ b/pkg/controller/cluster/cluster_controller.go @@ -440,6 +440,12 @@ func (c *clusterController) syncCluster(key string) error { return nil } + // currently we didn't set cluster.Spec.Enable when creating cluster at client side, so only check + // if we enable cluster.Spec.JoinFederation now + if cluster.Spec.JoinFederation == false { + return nil + } + // save a old copy of cluster oldCluster := cluster.DeepCopy()