Skip to content

Commit

Permalink
fix zone flags (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaByte875 authored Sep 15, 2023
1 parent 65db47e commit 60f7db6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions charts/nebula-operator/templates/scheduler-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 4 additions & 2 deletions pkg/controller/component/graphd_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions pkg/controller/component/storaged_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit 60f7db6

Please sign in to comment.