From c85823c5230e4a7b8b7f53a19da97d5e7db40c5f Mon Sep 17 00:00:00 2001 From: Yash Raj Date: Fri, 17 May 2024 10:38:39 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B1Remove=20if=20statement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hetznerbaremetalhost_controller.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/controllers/hetznerbaremetalhost_controller.go b/controllers/hetznerbaremetalhost_controller.go index 4629dcad5..aafade2a4 100644 --- a/controllers/hetznerbaremetalhost_controller.go +++ b/controllers/hetznerbaremetalhost_controller.go @@ -181,16 +181,15 @@ func (r *HetznerBareMetalHostReconciler) reconcileSelectedStates(ctx context.Con // Handle StateNone: check whether needs to be provisioned or deleted. case infrav1.StateNone: if !bmHost.DeletionTimestamp.IsZero() { - if !conditions.Has(bmHost, infrav1.HostReadyCondition) { - conditions.MarkFalse( - bmHost, - infrav1.HostReadyCondition, - infrav1.DeletionInProgressReason, - clusterv1.ConditionSeverityInfo, - "Host is not ready because it is being deleted", - ) - conditions.SetSummary(bmHost) - } + conditions.MarkFalse( + bmHost, + infrav1.HostReadyCondition, + infrav1.DeletionInProgressReason, + clusterv1.ConditionSeverityInfo, + "Host is not ready because it is being deleted", + ) + conditions.SetSummary(bmHost) + if bmHost.Spec.ConsumerRef == nil { bmHost.Spec.Status.ProvisioningState = infrav1.StateDeleting }