Skip to content

Commit

Permalink
Preserve the compute namespaces during undeploy (#258)
Browse files Browse the repository at this point in the history
Do not delete the compute namespaces when the SystemConfiguration resource
is deleted.

Signed-off-by: Dean Roehrich <[email protected]>
  • Loading branch information
roehrich-hpe authored Feb 7, 2024
1 parent d4c5588 commit 01f4598
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions internal/controller/nnf_systemconfiguration_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ type NnfSystemConfigurationReconciler struct {
// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
func (r *NnfSystemConfigurationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, err error) {
log := r.Log.WithValues("SystemConfiguration", req.NamespacedName)

metrics.NnfSystemConfigurationReconcilesTotal.Inc()

systemConfiguration := &dwsv1alpha2.SystemConfiguration{}
Expand All @@ -88,11 +86,6 @@ func (r *NnfSystemConfigurationReconciler) Reconcile(ctx context.Context, req ct
return ctrl.Result{}, nil
}

log.Info("Removing all compute node namespaces due to object deletion")
if err := r.deleteNamespaces(ctx, systemConfiguration, map[string]struct{}{}); err != nil {
return ctrl.Result{}, err
}

controllerutil.RemoveFinalizer(systemConfiguration, finalizerNnfSystemConfiguration)
if err := r.Update(ctx, systemConfiguration); err != nil {
if !apierrors.IsConflict(err) {
Expand Down

0 comments on commit 01f4598

Please sign in to comment.