diff --git a/pkg/controller/zookeepercluster/zookeepercluster_controller.go b/pkg/controller/zookeepercluster/zookeepercluster_controller.go index 67d4a3540..ed78a262a 100644 --- a/pkg/controller/zookeepercluster/zookeepercluster_controller.go +++ b/pkg/controller/zookeepercluster/zookeepercluster_controller.go @@ -234,8 +234,8 @@ func (r *ReconcileZookeeperCluster) reconcileStatefulSet(instance *zookeeperv1be return err } else { // check whether zookeeperCluster is updated before updating the sts - if !zookeeperClusterFresherThanSts(instance, sts) { - return fmt.Errorf("Staleness: cr.ResourceVersion %s is smaller than labeledRV %s", instance.ResourceVersion, sts.Labels["owner-rv"]) + if !zookeeperClusterFresherThanSts(instance, foundSts) { + return fmt.Errorf("Staleness: cr.ResourceVersion %s is smaller than labeledRV %s", instance.ResourceVersion, foundSts.Labels["owner-rv"]) } foundSTSSize := *foundSts.Spec.Replicas newSTSSize := *sts.Spec.Replicas