Skip to content

Commit 84284b1

Browse files
🌱 Update condition while updating the provisioning state (#1545)
update condition while updating the provisioning state hetzner baremetal host's condition should be updated when the provisioning state is updated, this removes the time lag between the provisioning state and condition while provisioning the bare metal server. Signed-off-by: Dhairya Arora <[email protected]>
1 parent aeab79b commit 84284b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/services/baremetal/host/state_machine.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ func (hsm *hostStateMachine) ReconcileState(ctx context.Context) (actionRes acti
7272
if hsm.nextState != initialState {
7373
hsm.log.V(1).Info("changing provisioning state", "old", initialState, "new", hsm.nextState)
7474
hsm.host.Spec.Status.ProvisioningState = hsm.nextState
75+
76+
cond := conditions.Get(hsm.host, infrav1.ProvisionSucceededCondition)
77+
if cond != nil && cond.Reason == infrav1.StillProvisioningReason {
78+
markProvisionPending(hsm.host, hsm.nextState)
79+
}
7580
}
7681
}()
7782

0 commit comments

Comments
 (0)