Skip to content

Commit

Permalink
Add TODO on clusterclaim_controller status handling
Browse files Browse the repository at this point in the history
Due to the introduction of status subresource awareness in the fake
client, it has been uncovered that, in cases of an assignment conflicts
between claims for a cluster, the AssignmentConflict condition was not
being set (requiring a `Status().Update()` call rather than `Update()`).

Update log message to reflect that spec (and not status) is being
updated, and add TODO to investigate behavior in
https://issues.redhat.com/browse/HIVE-2274

Signed-off-by: Leah Leshchinsky <lleshchi@redhat.com>
  • Loading branch information
lleshchi committed Aug 14, 2023
1 parent 6b7a6a9 commit 9b793ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/clusterclaim/clusterclaim_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ func (r *ReconcileClusterClaim) reconcileForExistingAssignment(claim *hivev1.Clu
func (r *ReconcileClusterClaim) reconcileForAssignmentConflict(claim *hivev1.ClusterClaim, logger log.FieldLogger) (reconcile.Result, error) {
logger.Info("claim assigned a cluster that has already been claimed by another ClusterClaim")
claim.Spec.Namespace = ""
// TODO: Update status handling https://issues.redhat.com/browse/HIVE-2274
claim.Status.Conditions = controllerutils.SetClusterClaimCondition(
claim.Status.Conditions,
hivev1.ClusterClaimPendingCondition,
Expand All @@ -507,7 +508,7 @@ func (r *ReconcileClusterClaim) reconcileForAssignmentConflict(claim *hivev1.Clu
controllerutils.UpdateConditionIfReasonOrMessageChange,
)
if err := r.Update(context.Background(), claim); err != nil {
logger.WithError(err).Log(controllerutils.LogLevel(err), "could not update status of ClusterClaim")
logger.WithError(err).Log(controllerutils.LogLevel(err), "could not update spec of ClusterClaim")
return reconcile.Result{}, err
}
return reconcile.Result{}, nil
Expand Down

0 comments on commit 9b793ba

Please sign in to comment.