Skip to content

Commit

Permalink
🌱Remove if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
yrs147 committed May 17, 2024
1 parent 8a134e3 commit c85823c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions controllers/hetznerbaremetalhost_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c85823c

Please sign in to comment.