Skip to content

Commit 5258ff4

Browse files
committed
fix issue-314 by checking zookeeperCluster resource version before updating sts ADDENDUM
Fix owner-rv check by checking the existing STS object
1 parent dfab559 commit 5258ff4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/controller/zookeepercluster/zookeepercluster_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ func (r *ReconcileZookeeperCluster) reconcileStatefulSet(instance *zookeeperv1be
234234
return err
235235
} else {
236236
// check whether zookeeperCluster is updated before updating the sts
237-
if !zookeeperClusterFresherThanSts(instance, sts) {
238-
return fmt.Errorf("Staleness: cr.ResourceVersion %s is smaller than labeledRV %s", instance.ResourceVersion, sts.Labels["owner-rv"])
237+
if !zookeeperClusterFresherThanSts(instance, foundSts) {
238+
return fmt.Errorf("Staleness: cr.ResourceVersion %s is smaller than labeledRV %s", instance.ResourceVersion, foundSts.Labels["owner-rv"])
239239
}
240240
foundSTSSize := *foundSts.Spec.Replicas
241241
newSTSSize := *sts.Spec.Replicas

0 commit comments

Comments
 (0)