Skip to content

Commit

Permalink
Use Patch() to update K8ssandraTask status (fixes k8ssandra#854)
Browse files Browse the repository at this point in the history
  • Loading branch information
olim7t committed Feb 8, 2023
1 parent f30afce commit 2b74ffc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG/CHANGELOG-1.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ When cutting a new release, update the `unreleased` heading to the tag being gen

## unreleased
* [FEATURE] [#739815](https://github.com/k8ssandra/k8ssandra-operator/issues/815) Add configuration block to CRDs for new Cassandra metrics agent.
* [BUGFIX] [#854](https://github.com/k8ssandra/k8ssandra-operator/issues/854) Use Patch() to update K8ssandraTask status.
3 changes: 2 additions & 1 deletion controllers/control/k8ssandratask_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ func (r *K8ssandraTaskReconciler) Reconcile(ctx context.Context, req ctrl.Reques
break
}
}
patch := client.MergeFrom(kTask.DeepCopy())
kTask.RefreshGlobalStatus(len(dcs))
if err = r.Status().Update(ctx, kTask); err != nil {
if err = r.Status().Patch(ctx, kTask, patch); err != nil {
return ctrl.Result{}, err
}
// If the status update set a completion time, we want to reconcile again in order to handle the TTL. But
Expand Down

0 comments on commit 2b74ffc

Please sign in to comment.