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

Add a finalizer on the InternalHubComponent #191

Conversation

JustinKuli
Copy link
Member

In some uninstallation situations, the finalizers on Policies and ConfigurationPolicies were not always resolved before the addons and the addon-controller were stopped. This resulted in resources and namespaces being stuck, and could cause issues during a re-install.

Now, this addon-controller will manage a finalizer on the "grc" InternalHubCluster, to prevent the addon-controller from being stopped while policy ManagedClusterAddOns still exist.

When the InternalHubComponent is present, anything that creates a ManagedClusterAddOn for this controller must ensure that they are deleted when the InterrnalHubComponent is deleted. This can be done with OwnerReferences. In RHACM, the klusterlet-addon-controller will do this.

Refs:

@JustinKuli JustinKuli force-pushed the 14707-uninstallation-coordination branch from 61b924f to f297988 Compare January 24, 2025 15:23
@JustinKuli JustinKuli force-pushed the 14707-uninstallation-coordination branch from f297988 to 632b6ff Compare January 24, 2025 19:55
@@ -19,6 +19,7 @@ const (
case2ManagedClusterAddOnName string = "config-policy-controller"
case2ManagedClusterAddOnCR string = "../resources/config_policy_addon_cr.yaml"
case2ClusterManagementAddOnCRDefault string = "../resources/config_policy_clustermanagementaddon.yaml"
case2InternalHubComponentCRDefault string = "../resources/grc_internalhubcomponent.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this CRD??

Copy link
Member Author

Choose a reason for hiding this comment

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

It's the instance of the CR. I could rename it ...DefaultCR if you think that's better

Copy link
Contributor

@yiraeChristineKim yiraeChristineKim Jan 27, 2025

Choose a reason for hiding this comment

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

Good DefaultCR anything except "-D"

@JustinKuli
Copy link
Member Author

/hold

Important comments about this approach have been made in stolostron/klusterlet-addon-controller#315, I'll need to look into.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
In some uninstallation situations, the finalizers on Policies and
ConfigurationPolicies were not always resolved before the addons and the
addon-controller were stopped. This resulted in resources and namespaces
being stuck, and could cause issues during a re-install.

Now, this addon-controller will manage a finalizer on the "grc"
InternalHubCluster, to prevent the addon-controller from being stopped
while policy ManagedClusterAddOns still exist.

When the InternalHubComponent is present, anything that creates a
ManagedClusterAddOn for this controller must ensure that they are
deleted when the InterrnalHubComponent is deleted. This can be done with
OwnerReferences. In RHACM, the klusterlet-addon-controller will do this.

Refs:
 - https://issues.redhat.com/browse/ACM-14707

Signed-off-by: Justin Kulikauskas <[email protected]>
@JustinKuli JustinKuli force-pushed the 14707-uninstallation-coordination branch from 632b6ff to 87924b2 Compare January 27, 2025 15:22
Copy link

openshift-ci bot commented Jan 27, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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 [JustinKuli,yiraeChristineKim]

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

@JustinKuli
Copy link
Member Author

We're going in another direction.

@JustinKuli JustinKuli closed this Feb 5, 2025
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.

None yet

2 participants