Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Rory Z <[email protected]>
  • Loading branch information
Rory-Z committed Sep 3, 2024
1 parent e18e023 commit e482789
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/apps/v2beta1/update_emqx_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ type updateStatus struct {
func (u *updateStatus) reconcile(ctx context.Context, logger logr.Logger, instance *appsv2beta1.EMQX, r innerReq.RequesterInterface) subResult {
if instance.Status.CoreNodesStatus == nil {
instance.Status.CoreNodesStatus = &appsv2beta1.EMQXNodesStatus{}
if err := u.Client.Status().Update(ctx, instance); err != nil {
return subResult{err: emperror.Wrap(err, "failed to update status")}
}
}
instance.Status.CoreNodesStatus.Replicas = *instance.Spec.CoreTemplate.Spec.Replicas
if instance.Status.CoreNodesStatus.UpdateRevision != "" && instance.Status.CoreNodesStatus.CurrentRevision == "" {
Expand All @@ -32,6 +35,9 @@ func (u *updateStatus) reconcile(ctx context.Context, logger logr.Logger, instan
if instance.Spec.ReplicantTemplate != nil {
if instance.Status.ReplicantNodesStatus == nil {
instance.Status.ReplicantNodesStatus = &appsv2beta1.EMQXNodesStatus{}
if err := u.Client.Status().Update(ctx, instance); err != nil {
return subResult{err: emperror.Wrap(err, "failed to update status")}
}
}
instance.Status.ReplicantNodesStatus.Replicas = *instance.Spec.ReplicantTemplate.Spec.Replicas
if instance.Status.ReplicantNodesStatus.UpdateRevision != "" && instance.Status.ReplicantNodesStatus.CurrentRevision == "" {
Expand Down

0 comments on commit e482789

Please sign in to comment.