Skip to content

Commit

Permalink
fix: disable reconciliation before scaling in SaaS (#476)
Browse files Browse the repository at this point in the history
While testing E2E test with scaling, noticed that the current `zbchaos
cluster scale` command do not work in SaaS because reconciliation is not
disabled.
  • Loading branch information
deepthidevaki authored Jan 12, 2024
2 parents 1e3972f + 7deb437 commit 54d137c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions go-chaos/cmd/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ func scaleCluster(flags *Flags) error {
return fmt.Errorf("cluster is already scaling")
}

err = k8Client.PauseReconciliation()
if err != nil {
return err
}

if len(currentTopology.Brokers) > flags.brokers {
_, err = scaleDownBrokers(k8Client, port, flags.brokers)
} else if len(currentTopology.Brokers) < flags.brokers {
Expand Down
1 change: 1 addition & 0 deletions go-chaos/internal/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (c K8Client) ScaleZeebeCluster(replicas int) (int, error) {
if err != nil {
return 0, err
}

statefulSets := c.Clientset.AppsV1().StatefulSets(namespace)
err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
currentScale, err := statefulSets.GetScale(ctx, sfs.Name, meta.GetOptions{})
Expand Down

0 comments on commit 54d137c

Please sign in to comment.