Skip to content
Prev Previous commit
Next Next commit
cleanup
Signed-off-by: Ben Luzarraga <[email protected]>
  • Loading branch information
bluzarraga committed Jan 31, 2025
commit d2a618526502e20a3610da9e8211a5114d08e024
19 changes: 3 additions & 16 deletions controllers/operandrequestnoolm/operandrequestnoolm_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Re
return ctrl.Result{Requeue: true}, err
}

// TODO this section is likely where we need to put in opreq cleanup logic.
//Many of the cleanup functions are run through reconcileoperator as of 1/31/25
//Many of the cleanup functions are run through reconcileoperator as of 1.31.25
//technically nothing is done to the operator deployment as of this writing (1.31.25)
// Reconcile Operators
if err := r.reconcileOperator(ctx, requestInstance); err != nil {
klog.Errorf("failed to reconcile Operators for OperandRequest %s: %v", req.NamespacedName.String(), err)
Expand Down Expand Up @@ -246,20 +246,7 @@ func (r *Reconciler) checkFinalizer(ctx context.Context, requestInstance *operat
for _, m := range requestInstance.Status.Members {
remainingOperands.Add(m.Name)
}
// TODO: update to check OperandRequest status to see if member is user managed or not
// existingSub := &olmv1alpha1.SubscriptionList{}

// opts := []client.ListOption{
// client.MatchingLabels(map[string]string{constant.OpreqLabel: "true"}),
// }

// if err := r.Client.List(ctx, existingSub, opts...); err != nil {
// return err
// }
// if len(existingSub.Items) == 0 {
// return nil
// }
// Delete all the subscriptions that created by current request
// Delete all the operands and configmaps that created by current request
if err := r.absentOperatorsAndOperands(ctx, requestInstance, &remainingOperands); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/operandrequestnoolm/reconcile_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (r *Reconciler) reconcileOpReqCM(ctx context.Context, requestInstance *oper
requestInstance.SetNoConflictOperatorCondition(operand.Name, operatorv1alpha1.ResourceTypeSub, corev1.ConditionTrue, mu)
}
} else {
// Subscription existing and not managed by OperandRequest controller
// Operator existing and not managed by OperandRequest controller
klog.V(1).Infof("Configmap %s in namespace %s isn't created by ODLM. Ignore update/delete it.", cm.Name, cm.Namespace)
}
return nil
Expand Down