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

Cleanup legacy OLM Subscription & CSVs #1282

Merged

Conversation

dprince
Copy link
Contributor

@dprince dprince commented Jan 30, 2025

This cleans up legacy resources installed by OLM dependencies in old releases by searching for specifically named resources.

This PR uses the unstructured client so that we don't have to import structs (and dependencies).

@openshift-ci openshift-ci bot requested review from fao89 and slagle January 30, 2025 01:50
@dprince dprince requested review from leifmadsen and abays January 30, 2025 01:50
@dprince
Copy link
Contributor Author

dprince commented Jan 30, 2025

Got this link from Joe today: https://github.com/operator-framework/kubectl-operator/blob/ddb2132976fa3e0ca5da63915c29c77b9240da70/internal/pkg/action/operator_uninstall.go#L186-L242 which may help us improve this further

Copy link
Contributor

@bshephar bshephar left a comment

Choose a reason for hiding this comment

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

Very nice feature considering how we're changing the installation process. Makes users life much easier.

controllers/operator/openstack_controller.go Outdated Show resolved Hide resolved
@dprince dprince marked this pull request as draft January 30, 2025 12:49
@leifmadsen
Copy link
Contributor

Looks ok to me. What are the leftover "operator" resources?

@dprince dprince marked this pull request as ready for review January 31, 2025 14:46
@openshift-ci openshift-ci bot requested review from stuggi and viroel January 31, 2025 14:46
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/8792d2b1fecf48c6a9edbb1ba9e8cdfa

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 19m 23s
podified-multinode-edpm-deployment-crc FAILURE in 32m 36s
cifmw-crc-podified-edpm-baremetal FAILURE in 33m 27s
openstack-operator-tempest-multinode FAILURE in 37m 02s

@dprince dprince force-pushed the csv_cleanup branch 5 times, most recently from 5e2c837 to ccb4c8d Compare February 2, 2025 14:11
@dprince
Copy link
Contributor Author

dprince commented Feb 3, 2025

Looks ok to me. What are the leftover "operator" resources?

oc get operator

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/cfbc782bfd7b4920820bbd4a898aa6d2

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 49m 26s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 14m 13s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 35m 37s
openstack-operator-tempest-multinode FAILURE in 1h 14m 50s

@dprince
Copy link
Contributor Author

dprince commented Feb 4, 2025

recheck

@dprince
Copy link
Contributor Author

dprince commented Feb 4, 2025

/test openstack-operator-build-deploy-kuttl

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/e4c063dbf7274000990415b9496233b0

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 18m 54s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 23m 31s
cifmw-crc-podified-edpm-baremetal RETRY_LIMIT in 13m 14s
✔️ openstack-operator-tempest-multinode SUCCESS in 1h 42m 39s

@abays
Copy link
Contributor

abays commented Feb 4, 2025

recheck

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/ceefaeaa50c74f089daded35a9a2fe04

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 02m 04s
podified-multinode-edpm-deployment-crc POST_FAILURE in 1h 21m 42s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 21m 42s
✔️ openstack-operator-tempest-multinode SUCCESS in 1h 48m 07s

@dprince
Copy link
Contributor Author

dprince commented Feb 5, 2025

recheck

Copy link
Contributor

@stuggi stuggi left a comment

Choose a reason for hiding this comment

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

/lgtm

@dprince
Copy link
Contributor Author

dprince commented Feb 6, 2025

/test precommit-check

This cleans up legacy resources installed by OLM dependencies in
old releases by searching for specifically named resources.

This PR uses the unstructured client so that we don't have to import
structs (and dependencies).

NOTE: This PR does not yet address the leftover 'operator'
resources which persist and seem to get recreated even
if removed.
This will allow cleanup of 'operator' objects which
own these resources and got created by service operators
prior to FR2
The operator resource's have references to:
 -CSVs
 -Subscriptions
 -Installplans
 -CRDs

So the cleanup for operators needs to run after applyCRDs
where 'olm.managed' gets removed.
The horizon operator CR has references to an old Role/Binding.
This code will cleanup those objects before attempting to
delete the operator and requeue. On 2nd attempt the role/binding
refs should have time to delete and the final reconcile will
complete.
Copy link
Contributor

@abays abays left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Feb 6, 2025
Copy link
Contributor

openshift-ci bot commented Feb 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, dprince, stuggi

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:
  • OWNERS [abays,dprince,stuggi]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dprince
Copy link
Contributor Author

dprince commented Feb 6, 2025

/test openstack-operator-build-deploy-kuttl

3 similar comments
@dprince
Copy link
Contributor Author

dprince commented Feb 6, 2025

/test openstack-operator-build-deploy-kuttl

@dprince
Copy link
Contributor Author

dprince commented Feb 6, 2025

/test openstack-operator-build-deploy-kuttl

@dprince
Copy link
Contributor Author

dprince commented Feb 6, 2025

/test openstack-operator-build-deploy-kuttl

@openshift-merge-bot openshift-merge-bot bot merged commit fae8f3b into openstack-k8s-operators:main Feb 7, 2025
7 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.

6 participants