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

Manual sync of #104 #421

Merged
merged 1 commit into from
Feb 13, 2023
Merged

Conversation

mprahl
Copy link
Contributor

@mprahl mprahl commented Feb 13, 2023

Previous to this, a finalizer on the Deployment was added so that if the
Deployment was deleted, it would handle immediate clean up. This doesn't
handle the common case where the config-policy-controller ManagedClusterAddOn
is deleted, which causes the ManifestWork to be deleted, which triggers
all Configuration Policy controller deployment artifacts, including the
service account.

A new approach is taken so that a new annotation of
policy.open-cluster-management.io/uninstalling=true is set on the
Deployment to indicate that the Configuration Policy controller should
remove all finalizers because it's getting deleted.

The Policy Addon controller will be updated so that when the
config-policy-controller ManagedClusterAddOn object is deleted, a
finalizer will prevent it and a Pod will run on the managed cluster with
the new `trigger-uninstall` subcommand. This sets the uninstalling
annotation on the Deployment and then waits until all
ConfigurationPolicy finalizers have been removed. Once the command ends,
the Pod exits, and the ManagedClusterAddOn object's finalizer is removed
and the uninstall proceeds.

Relates:
https://issues.redhat.com/browse/ACM-3233
https://issues.redhat.com/browse/ACM-2923

Signed-off-by: mprahl <mprahl@users.noreply.github.com>
(cherry picked from commit 9c674ae)
@openshift-ci
Copy link

openshift-ci bot commented Feb 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhaiducek, 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

@sonarcloud
Copy link

sonarcloud bot commented Feb 13, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

53.5% 53.5% Coverage
0.0% 0.0% Duplication

@openshift-merge-robot openshift-merge-robot merged commit 817f8cc into stolostron:main Feb 13, 2023
@mprahl
Copy link
Contributor Author

mprahl commented Feb 14, 2023

/cherry-pick release-2.7

@openshift-cherrypick-robot

@mprahl: #421 failed to apply on top of branch "release-2.7":

Applying: Trigger uninstalls through a new annotation
Using index info to reconstruct a base tree...
M	.github/workflows/kind.yml
M	Makefile
M	controllers/configurationpolicy_controller.go
M	deploy/manager/manager.yaml
M	main.go
Falling back to patching base and 3-way merge...
Auto-merging main.go
Auto-merging deploy/manager/manager.yaml
Auto-merging controllers/configurationpolicy_controller.go
CONFLICT (content): Merge conflict in controllers/configurationpolicy_controller.go
Auto-merging Makefile
CONFLICT (content): Merge conflict in Makefile
Auto-merging .github/workflows/kind.yml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Trigger uninstalls through a new annotation
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-2.7

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.

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.

😿 Failed to sync the upstream PRs: #104
4 participants