Skip to content
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

Redesign for ClusterVersion controller into OperatorConfigMap controller #64

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

bernerhat
Copy link
Contributor

Fixes the issue created where resources are leftover while trying to uninstall the odf client operator.

While trying to uninstall the operator clusterVersion resource, which is managed by OCP, remains in the cluster hence is not being deleted and causing the controller owned resources to remain as well.
Therefore a need arose to change the 'watched' resource from the clusterVersion into another resource who is more appropriate and in this case the ConfigMap of the operator was chosen.

Copy link

openshift-ci bot commented Jan 25, 2024

@bernerhat: This pull request references Bugzilla bug 2251308, which is valid.

No validations were run on this bug

No GitHub users were found matching the public email listed for the QA contact in Bugzilla ([email protected]), skipping review request.

In response to this:

Bug 2251308: Redesign for ClusterVersion controller into OperatorConfigMap controller

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
Copy link
Contributor

@leelavg leelavg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • pls follow if err := func(); err != nil {} convention if returning directly based on error

While trying to uninstall the operator clusterVersion resource, which is managed by OCP

  • I don't think so, no resource is being owned by clusterversion resource
  • Actually bug fix should just be moving the DeepCopy line before owning it and removing finalizer on CSIAddonNode

  • unless we really don't want to watch for a delete event on configmap I don't think we need a redesign

@Madhu-1 pls correct me if my understand of existing code and the fix is wrong.

controllers/operatorconfigmap_controller.go Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
@Madhu-1
Copy link
Member

Madhu-1 commented Jan 29, 2024

  • pls follow if err := func(); err != nil {} convention if returning directly based on error

While trying to uninstall the operator clusterVersion resource, which is managed by OCP

  • I don't think so, no resource is being owned by clusterversion resource

  • Actually bug fix should just be moving the DeepCopy line before owning it and removing finalizer on CSIAddonNode

  • unless we really don't want to watch for a delete event on configmap I don't think we need a redesign

@Madhu-1 pls correct me if my understand of existing code and the fix is wrong.

@leelavg are we trying to cleanup this things as part of uninstall? i mentioned about DeepCopy and CSIADDONS in my earlier comments. watching configmap is correct (i think) but there are many other changes in this PR)

@nb-ohad
Copy link
Contributor

nb-ohad commented Jan 29, 2024

@leelavg are we trying to cleanup this things as part of uninstall? i mentioned about DeepCopy and CSIADDONS in my earlier comments. watching configmap is correct (i think) but there are many other changes in this PR)

@Madhu-1
This PR is not only about the change to the config map. It is about solving the uninstallation bug - the config map change is just one part of it.

A PR, from my point of view, should be a complete contribution which this PR is and I don't see an issue with it.
But I do agree that we need to separate concerns and changes, so using a separate commit for each distinct change can be helpful here

@bernerhat Can you act on my suggestion above?

controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
@bernerhat bernerhat force-pushed the BZ-2251308 branch 2 times, most recently from ec056aa to 8f672fe Compare January 30, 2024 09:00
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
@Madhu-1
Copy link
Member

Madhu-1 commented Jan 30, 2024

Please take care of deleting the SCC as well

@leelavg
Copy link
Contributor

leelavg commented Jan 30, 2024

all my comments can be resolved and pls remove bug id from the title and commit, bugs are mentioned only during backports. you can mention the id in description or as a comment though.

@bernerhat bernerhat force-pushed the BZ-2251308 branch 2 times, most recently from adf705a to 8e23bbf Compare February 4, 2024 08:42
@pull-request-size pull-request-size bot added size/L and removed size/M labels Feb 4, 2024
@bernerhat
Copy link
Contributor Author

does other PRs #79, #80, #81 deprecates this PR?

No, this code still needs to be tested and merged.

@bernerhat
Copy link
Contributor Author

/hold

controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
controllers/operatorconfigmap_controller.go Outdated Show resolved Hide resolved
@bernerhat bernerhat force-pushed the BZ-2251308 branch 3 times, most recently from bd72263 to 2c79227 Compare March 20, 2024 22:51
@bernerhat
Copy link
Contributor Author

/unhold

@bernerhat
Copy link
Contributor Author

code is now tested.

fixed ownership of resources and remove finalizer in deletion

Signed-off-by: Amit Berner <[email protected]>
@nb-ohad
Copy link
Contributor

nb-ohad commented Apr 3, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Apr 3, 2024
Copy link

openshift-ci bot commented Apr 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bernerhat, nb-ohad

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Apr 3, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit c99ef2f into red-hat-storage:main Apr 3, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants