Skip to content

Commit

Permalink
[Bugfix] Consider Cn Replicas when calculating component hash (#392)
Browse files Browse the repository at this point in the history
Signed-off-by: yandongxiao <[email protected]>
  • Loading branch information
yandongxiao authored Jan 9, 2024
1 parent f91557e commit 8ea054c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/subcontrollers/cn/cn_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,12 @@ func (cc *CnController) SyncCnSpec(ctx context.Context, object object.StarRocksO
return err
}
sts := statefulset.MakeStatefulset(object, cnSpec, *podTemplateSpec)
if err = k8sutils.ApplyStatefulSet(ctx, cc.k8sClient, &sts, func(st1 *appv1.StatefulSet, st2 *appv1.StatefulSet) bool {
return rutils.StatefulSetDeepEqual(st1, st2, true)
if err = k8sutils.ApplyStatefulSet(ctx, cc.k8sClient, &sts, func(expect *appv1.StatefulSet, actual *appv1.StatefulSet) bool {
if expect.Spec.Replicas == nil {
return rutils.StatefulSetDeepEqual(expect, actual, true)
} else {
return rutils.StatefulSetDeepEqual(expect, actual, false)
}
}); err != nil {
return err
}
Expand Down

0 comments on commit 8ea054c

Please sign in to comment.