-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix bug when removing finalizer #22
Conversation
Signed-off-by: Michael Honaker <[email protected]>
Signed-off-by: Michael Honaker <[email protected]>
99ef2e5
to
0ae6282
Compare
Signed-off-by: Michael Honaker <[email protected]>
4d5b0ec
to
9cf38f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look like good fixes. They should take care of the resource validation issues when adjusting the finalizers
if not self._cluster_content[namespace][kind][api_version][name][ | ||
"metadata" | ||
].get("finalizers"): | ||
callback(self._cluster_content[namespace][kind][api_version][name]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be behind the DRY_RUN_CLUSTER_LOCK
(or alternately, have the value pulled above and then used here)?
@@ -243,7 +247,14 @@ def remove_finalizer(session: SESSION_TYPE, finalizer: str): | |||
|
|||
log.debug("Removing finalizer: %s", finalizer) | |||
|
|||
manifest = copy.deepcopy(session.cr_manifest) | |||
# Create manifest with only required fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, perfect. This will be much simpler
@@ -105,8 +105,10 @@ def run_reconcile(self, is_finalizer: bool, resource: dict): | |||
if ( | |||
self._resource.get("kind") == resource.get("kind") | |||
and self._resource.get("apiVersion") == resource.get("apiVersion") | |||
and resource_metadata.get("name") == resource_metadata.get("name") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes! Those were certainly buggy
Related Issue
Supports #?
Related PRs
This PR is not dependent on any other PR
What this PR does / why we need it
This PR updates the
remove_finalizer
utility to only apply the necessary parameters instead of applying the whole resource.Special notes for your reviewer
If applicable**
What gif most accurately describes how I feel towards this PR?