fix: remove finalizer when validation label is removed from pod - #179
Merged
Merged
Conversation
When a user removes the validation.ml.sigstore.dev/ml label from a running pod, the PodReconciler now removes the finalizer before cleaning up tracking. Previously the finalizer was left behind, preventing the pod from being garbage-collected until an explicit deletion event. Signed-off-by: Sachin Sampras M <sampras343@gmail.com>
Signed-off-by: Sachin Sampras M <sampras343@gmail.com>
miyunari
approved these changes
Sep 14, 2026
miyunari
left a comment
Member
There was a problem hiding this comment.
@sampras343 may I ask, why does it need a finalizer at all?
Contributor
Author
My understanding is that the finalizer currently serves as a signal to distinguish injected pods from uninjected ones in the StatusTracker (pods with label but not mutated by the webhook). It also ensures the reconciler sees the deletion event before the pod is garbage collected. Now that I'm thinking, both uses could potentially be replaced. The injected-at annotation already marks injection, and the NotFound path in the reconciler already handles cleanup without needing to delay deletion. Do you think removing the finalizer entirely make sense? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #180
Summary
validation.ml.sigstore.dev/finalizerfrom pods when thevalidation.ml.sigstore.dev/mllabel is removedFix
In the label-absent branch of
PodReconciler.Reconcile(), check for and remove the finalizer before cleaning up tracking. This matches the deletion path behavior.Test plan
go build ./...passes