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

Use a predelete hook to cleanly uninstall the config-policy-controller #60

Merged

Conversation

mprahl
Copy link
Member

@mprahl mprahl commented Feb 8, 2023

This change makes it so that a finalizer is added to the
config-policy-controller ManagedClusterAddOn object. Now when it is deleted,
it will trigger an additional ManifestWork to create a Pod which
signals to the config-policy-controller that it's being uninstalled and
it waits for all ConfigurationPolicy objects to have their finalizers
removed before exiting. Once the Pod exits successfully, the finalizer
on the ManagedClusterAddOn object is removed and the
config-policy-controller uninstall proceeds.

If there are a lot of policies, it may take longer than 30 seconds, so
the grace period was bumped up to 120 seconds to exit cleanly.

Note that now with KIND_VERSION set to minimum, it uses a newer version
for the Hub to match the lowest supported version for the Hub. This is
to work around this:
open-cluster-management-io/api#206

See this related PR:
open-cluster-management-io/config-policy-controller#104

Comment on lines -15 to -16
open-cluster-management.io/addon-framework v0.5.1-0.20221206033210-55b40b1bc8c6
open-cluster-management.io/api v0.8.1-0.20220919023232-a2688935edf3
Copy link
Member

Choose a reason for hiding this comment

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

Were these necessary for a feature?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not necessary, but I saw that we were running a prerelease version and decided to sneak in an update.

I can make this a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

And I hadn't noticed we had a pre-release version. The update should be good.

Copy link
Member

Choose a reason for hiding this comment

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

The prerelease was to catch a hosted mode annotation update, which had a typo. (You know me and typos!) Update should be fine.

@mprahl
Copy link
Member Author

mprahl commented Feb 8, 2023

/hold until the config-policy-controller PR is approved

@mprahl
Copy link
Member Author

mprahl commented Feb 8, 2023

The tests pass locally once the config-policy-controller PR is merged.

JustinKuli
JustinKuli previously approved these changes Feb 8, 2023
JustinKuli
JustinKuli previously approved these changes Feb 8, 2023
This change makes it so that a finalizer is added to the
config-policy-controller ManagedClusterAddOn object. Now when it is deleted,
it will trigger an additional ManifestWork to create a Pod which
signals to the config-policy-controller that it's being uninstalled and
it waits for all ConfigurationPolicy objects to have their finalizers
removed before exiting. Once the Pod exits successfully, the finalizer
on the ManagedClusterAddOn object is removed and the
config-policy-controller uninstall proceeds.

If there are a lot of policies, it may take longer than 30 seconds, so
the grace period was bumped up to 120 seconds to exit cleanly.

Note that now with KIND_VERSION set to minimum, it uses a newer version
for the Hub to match the lowest supported version for the Hub. This is
to work around this:
open-cluster-management-io/api#206

Signed-off-by: mprahl <mprahl@users.noreply.github.com>
@openshift-ci openshift-ci bot added the lgtm label Feb 13, 2023
@openshift-ci
Copy link

openshift-ci bot commented Feb 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JustinKuli, mprahl

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

@mprahl
Copy link
Member Author

mprahl commented Feb 13, 2023

/unhold

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.

4 participants