Skip to content

Commit f22af09

Browse files
committed
Adjust Host Lease phases so that it is not Ready until after its template is complete
1 parent c585d85 commit f22af09

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

internal/controller/hostlease_controller.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ func (r *HostLeaseReconciler) handleUpdate(ctx context.Context, hostLease *v1alp
116116
return ctrl.Result{}, nil
117117
}
118118

119-
if hostLease.Status.Phase == "" {
120-
hostLease.Status.Phase = v1alpha1.HostLeasePhaseProgressing
121-
}
119+
hostLease.Status.Phase = v1alpha1.HostLeasePhaseProgressing
122120

123121
if !controllerutil.ContainsFinalizer(hostLease, hostLeaseFinalizer) {
124122
controllerutil.AddFinalizer(hostLease, hostLeaseFinalizer)
@@ -138,6 +136,9 @@ func (r *HostLeaseReconciler) handleUpdate(ctx context.Context, hostLease *v1alp
138136
if !result.IsZero() {
139137
return result, nil
140138
}
139+
if hostLease.Status.Phase == v1alpha1.HostLeasePhaseFailed {
140+
return result, nil
141+
}
141142
}
142143

143144
node, err := r.IronicClient.GetNode(ctx, hostLease.Spec.ExternalHostID)

0 commit comments

Comments
 (0)