Skip to content

Commit 979d06f

Browse files
committed
Onboarding: Fix onboarding abort reason
The same message was used for two different causes. Fixed that.
1 parent 01f561b commit 979d06f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

internal/controller/onboarding_controller.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ func (r *OnboardingController) Reconcile(ctx context.Context, req ctrl.Request)
8888

8989
// check if lifecycle management is enabled
9090
if !hv.Spec.LifecycleEnabled {
91-
return ctrl.Result{}, r.abortOnboarding(ctx, hv, computeHost)
91+
return ctrl.Result{}, r.abortOnboarding(ctx, hv, computeHost, "Aborted due to LifecycleEnabled being false")
9292
}
9393

9494
// check if hv is terminating
9595
if hv.Spec.Maintenance == kvmv1.MaintenanceTermination {
96-
return ctrl.Result{}, r.abortOnboarding(ctx, hv, computeHost)
96+
return ctrl.Result{}, r.abortOnboarding(ctx, hv, computeHost, "Aborted due to MaintenanceTermination")
9797
}
9898

9999
// We bail here out, because the openstack api is not the best to poll
@@ -137,7 +137,7 @@ func (r *OnboardingController) Reconcile(ctx context.Context, req ctrl.Request)
137137
}
138138
}
139139

140-
func (r *OnboardingController) abortOnboarding(ctx context.Context, hv *kvmv1.Hypervisor, computeHost string) error {
140+
func (r *OnboardingController) abortOnboarding(ctx context.Context, hv *kvmv1.Hypervisor, computeHost, message string) error {
141141
status := meta.FindStatusCondition(hv.Status.Conditions, kvmv1.ConditionTypeOnboarding)
142142
// Never onboarded
143143
if status == nil {
@@ -150,7 +150,7 @@ func (r *OnboardingController) abortOnboarding(ctx context.Context, hv *kvmv1.Hy
150150
Type: kvmv1.ConditionTypeOnboarding,
151151
Status: metav1.ConditionFalse,
152152
Reason: kvmv1.ConditionReasonAborted,
153-
Message: "Aborted due to LifecycleEnabled being false",
153+
Message: message,
154154
})
155155

156156
if equality.Semantic.DeepEqual(hv, base) {

0 commit comments

Comments
 (0)