Skip to content

Commit

Permalink
fix: disable reconciliation before scaling in SaaS
Browse files Browse the repository at this point in the history
  • Loading branch information
deepthidevaki committed Jan 10, 2024
1 parent 1e3972f commit 366d41a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions go-chaos/internal/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package internal
import (
"context"
"errors"
"fmt"
"time"

v1 "k8s.io/api/apps/v1"
Expand Down Expand Up @@ -55,6 +56,14 @@ func (c K8Client) ScaleZeebeCluster(replicas int) (int, error) {
if err != nil {
return 0, err
}

if c.SaaSEnv {
pauseError := c.PauseReconciliation()
if pauseError != nil {
fmt.Errorf("Failed to disable reconciliation before scaling statefulset")
return 0, pauseError
}
}
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 366d41a

Please sign in to comment.