Skip to content

Commit

Permalink
undo this commit
Browse files Browse the repository at this point in the history
Signed-off-by: dislbenn <dbennett@redhat.com>
  • Loading branch information
dislbenn committed Oct 7, 2024
1 parent 789c2ba commit 815455d
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions controllers/backplaneconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1642,31 +1642,31 @@ func (r *MultiClusterEngineReconciler) finalizeBackplaneConfig(ctx context.Conte
return ctrl.Result{}, err
}

localClusterNS := &corev1.Namespace{}
if err := r.Client.Get(ctx, types.NamespacedName{Name: "local-cluster"}, localClusterNS); err == nil {
// If wait time exceeds expected then uninstall may not be able to progress
if time.Since(backplaneConfig.DeletionTimestamp.Time) < 10*time.Minute {
terminatingCondition := status.NewCondition(
backplanev1.MultiClusterEngineConditionType(
backplanev1.MultiClusterEngineProgressing), metav1.ConditionTrue, status.WaitingForResourceReason,
"Waiting for namespace local-cluster to terminate.")

r.StatusManager.AddCondition(terminatingCondition)
} else {
terminatingCondition := status.NewCondition(
backplanev1.MultiClusterEngineConditionType(backplanev1.MultiClusterEngineProgressing),
metav1.ConditionFalse, status.WaitingForResourceReason,
"Namespace local-cluster still exists.")

r.StatusManager.AddCondition(terminatingCondition)
}

return ctrl.Result{}, fmt.Errorf(
"waiting for 'local-cluster' namespace to be terminated before proceeding with uninstallation")

} else if !apierrors.IsNotFound(err) {
return ctrl.Result{}, err
}
// localClusterNS := &corev1.Namespace{}
// if err := r.Client.Get(ctx, types.NamespacedName{Name: "local-cluster"}, localClusterNS); err == nil {
// // If wait time exceeds expected then uninstall may not be able to progress
// if time.Since(backplaneConfig.DeletionTimestamp.Time) < 10*time.Minute {
// terminatingCondition := status.NewCondition(
// backplanev1.MultiClusterEngineConditionType(
// backplanev1.MultiClusterEngineProgressing), metav1.ConditionTrue, status.WaitingForResourceReason,
// "Waiting for namespace local-cluster to terminate.")

// r.StatusManager.AddCondition(terminatingCondition)
// } else {
// terminatingCondition := status.NewCondition(
// backplanev1.MultiClusterEngineConditionType(backplanev1.MultiClusterEngineProgressing),
// metav1.ConditionFalse, status.WaitingForResourceReason,
// "Namespace local-cluster still exists.")

// r.StatusManager.AddCondition(terminatingCondition)
// }

// return ctrl.Result{}, fmt.Errorf(
// "waiting for 'local-cluster' namespace to be terminated before proceeding with uninstallation")

// } else if !apierrors.IsNotFound(err) {
// return ctrl.Result{}, err
// }

return ctrl.Result{}, nil
}
Expand Down

0 comments on commit 815455d

Please sign in to comment.