-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration uninstall configmap from DSC to setup controller #1438
Migration uninstall configmap from DSC to setup controller #1438
Conversation
Could you put description in the commit message? |
} | ||
|
||
// Fetch the DataScienceCluster instance | ||
if len(instances.Items) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100% :)
platform := currentOperatorRelease.Name | ||
instances := &dscv1.DataScienceClusterList{} | ||
|
||
// Check if the delete ConfigMap exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obvious from the function name actually
return reconcile.Result{}, nil | ||
} | ||
|
||
// Fetch the DataScienceCluster instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should go above this right ? instances := &dscv1.DataScienceClusterList{}
|
||
// Check if the delete ConfigMap exists | ||
if !upgrade.HasDeleteConfigMap(ctx, r.Client) { | ||
log.Info("No delete ConfigMap found, skipping reconciliation") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, loglevels can be revisited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, maybe in separate PR or probably after we decide the workflow for this intended task is good.
} | ||
} | ||
// Delete the DataScienceCluster instance | ||
if err := r.Client.Delete(ctx, instance, []client.DeleteOption{}...); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the trick with the options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just picked it up from here: https://github.com/opendatahub-io/opendatahub-operator/blob/main/controllers/datasciencecluster/datasciencecluster_controller.go#L127
Introduced by 9227687 ("Fix: uninstallation for operator (#796)")
@zdtsw ? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap.
@ykaliuta Thanks for the review. Updated the description Let me know if you have any other questions Additionally, |
ec46ccf
to
0a5c917
Compare
0a5c917
to
56f8901
Compare
f48a300
to
58d79a2
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1438 +/- ##
=======================================
Coverage ? 19.10%
=======================================
Files ? 158
Lines ? 10362
Branches ? 0
=======================================
Hits ? 1980
Misses ? 8158
Partials ? 224 ☔ View full report in Codecov by Sentry. |
return ctrl.Result{}, nil | ||
case err != nil: | ||
return ctrl.Result{}, err | ||
if err := r.Client.Get(ctx, req.NamespacedName, instance); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a check fr "NotFound" error is probably needed, in such case, the reconciliation loop can return early
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap makes sense. I'll update this.
/retest |
1 similar comment
/retest |
|
||
func (r *SetupControllerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { | ||
log := logf.FromContext(ctx).WithName("SetupController") | ||
log.Info("Reconciling setup controller", "Request.Name", req.Name) // log.V(1).Info(...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Request.Name", req.Name
is probably redundant as it should be included already in the log passed to the within the context. Can you confirm ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you're correct it does get passed from within the context.
This is the log for this bit
{"level":"info","ts":"2024-12-16T14:00:12Z","logger":"SetupContoller","msg":"Reconciling setup controller","controller":"configmap","controllerGroup":"","controllerKind":"ConfigMap","ConfigMap":{"name":"delete-configmap","namespace":"opendatahub-operator-system"},"namespace":"opendatahub-operator-system","name":"delete-configmap","reconcileID":"1c11083d-f086-4198-bfde-ba26a7f7fc38","Request.Name":"delete-configmap"}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is similar to that in DSC controller too. But maybe it makes sense for the DSC and not for the setup controller? Or should it be removed from there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably it should be revisited in the DSC controller too, for the moment I would just fix it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍 Updated the setup controller only
/retest |
1 similar comment
/retest |
LGTM, @grdryn anything missing ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm 👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: grdryn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1b0ec88
to
b2af7e2
Compare
/lgtm |
/retest |
2 similar comments
/retest |
/retest |
56109a7
into
opendatahub-io:main
Description
JIRA: RHOAIENG-16674
Created a new setup-controller and moved the below functionalities to uninstallation.go if
HasDeleteConfigMap
existsHow Has This Been Tested?
Testing process :
delete-configmap
withScreenshot or short clip
Merge criteria