From 7949a7c3aec6e555f47d5044718b7aa39a71af90 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Wed, 28 Sep 2022 00:10:04 +0200 Subject: [PATCH] [Bugfix] Always stop Sync if disabled (#1130) --- CHANGELOG.md | 1 + pkg/deployment/reconcile/plan_builder_scale.go | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3128de75..a8ec8f3f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - (Bugfix) Prevent LifeCycle restarts - (Bugfix) Change SyncWorker Affinity to Soft - (Feature) Add HostAliases for Sync +- (Bugfix) Always stop Sync if disabled ## [1.2.17](https://github.com/arangodb/kube-arangodb/tree/1.2.17) (2022-09-22) - (Feature) Add new field to DeploymentReplicationStatus with details on DC2DC sync status= diff --git a/pkg/deployment/reconcile/plan_builder_scale.go b/pkg/deployment/reconcile/plan_builder_scale.go index 4f6d98fc3..cf5bb70a3 100644 --- a/pkg/deployment/reconcile/plan_builder_scale.go +++ b/pkg/deployment/reconcile/plan_builder_scale.go @@ -63,8 +63,13 @@ func (r *Reconciler) createScaleMemberPlan(ctx context.Context, apiObject k8suti } if spec.GetMode().SupportsSync() { // Scale syncmasters & syncworkers - plan = append(plan, r.createScalePlan(status, status.Members.SyncMasters, api.ServerGroupSyncMasters, spec.SyncMasters.GetCount(), context)...) - plan = append(plan, r.createScalePlan(status, status.Members.SyncWorkers, api.ServerGroupSyncWorkers, spec.SyncWorkers.GetCount(), context)...) + if spec.Sync.IsEnabled() { + plan = append(plan, r.createScalePlan(status, status.Members.SyncMasters, api.ServerGroupSyncMasters, spec.SyncMasters.GetCount(), context)...) + plan = append(plan, r.createScalePlan(status, status.Members.SyncWorkers, api.ServerGroupSyncWorkers, spec.SyncWorkers.GetCount(), context)...) + } else { + plan = append(plan, r.createScalePlan(status, status.Members.SyncMasters, api.ServerGroupSyncMasters, 0, context)...) + plan = append(plan, r.createScalePlan(status, status.Members.SyncWorkers, api.ServerGroupSyncWorkers, 0, context)...) + } } return plan