From 60f7db6ed66c2ac188f6436eec0fda5aa832d53c Mon Sep 17 00:00:00 2001 From: "kevin.qiao" Date: Fri, 15 Sep 2023 18:48:53 +0800 Subject: [PATCH] fix zone flags (#279) --- .../templates/scheduler-configmap.yaml | 1 + pkg/controller/component/graphd_cluster.go | 6 ++++-- pkg/controller/component/storaged_cluster.go | 12 ++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/charts/nebula-operator/templates/scheduler-configmap.yaml b/charts/nebula-operator/templates/scheduler-configmap.yaml index 922b4d3b..89cb3473 100644 --- a/charts/nebula-operator/templates/scheduler-configmap.yaml +++ b/charts/nebula-operator/templates/scheduler-configmap.yaml @@ -10,6 +10,7 @@ metadata: data: scheduler-config.yaml: | apiVersion: kubescheduler.config.k8s.io/v1 + kind: KubeSchedulerConfiguration profiles: # Compose all plugins in one profile - schedulerName: {{ .Values.scheduler.schedulerName }} diff --git a/pkg/controller/component/graphd_cluster.go b/pkg/controller/component/graphd_cluster.go index 8ae7a1e5..b9b45ab3 100644 --- a/pkg/controller/component/graphd_cluster.go +++ b/pkg/controller/component/graphd_cluster.go @@ -105,8 +105,10 @@ func (c *graphdCluster) syncGraphdWorkload(nc *v1alpha1.NebulaCluster) error { } if notExist { - if err := syncZoneConfigMap(nc.GraphdComponent(), c.clientSet.ConfigMap()); err != nil { - return err + if nc.IsZoneEnabled() { + if err := syncZoneConfigMap(nc.GraphdComponent(), c.clientSet.ConfigMap()); err != nil { + return err + } } if err := extender.SetLastAppliedConfigAnnotation(newWorkload); err != nil { return err diff --git a/pkg/controller/component/storaged_cluster.go b/pkg/controller/component/storaged_cluster.go index 6bd61076..5cd4108d 100644 --- a/pkg/controller/component/storaged_cluster.go +++ b/pkg/controller/component/storaged_cluster.go @@ -119,8 +119,10 @@ func (c *storagedCluster) syncStoragedWorkload(nc *v1alpha1.NebulaCluster) error } if notExist { - if err := syncZoneConfigMap(nc.StoragedComponent(), c.clientSet.ConfigMap()); err != nil { - return err + if nc.IsZoneEnabled() { + if err := syncZoneConfigMap(nc.StoragedComponent(), c.clientSet.ConfigMap()); err != nil { + return err + } } if err := extender.SetLastAppliedConfigAnnotation(newWorkload); err != nil { return err @@ -182,8 +184,10 @@ func (c *storagedCluster) syncStoragedWorkload(nc *v1alpha1.NebulaCluster) error return fmt.Errorf("update storaged cluster %s dynamic flags failed: %v", newWorkload.GetName(), err) } - if err := c.updateZoneMappings(nc, *newReplicas); err != nil { - return fmt.Errorf("update zone mappings failed: %v", err) + if nc.IsZoneEnabled() { + if err := c.updateZoneMappings(nc, *newReplicas); err != nil { + return fmt.Errorf("update zone mappings failed: %v", err) + } } }