fix: resolve finalizer failure with Kyverno webhook integration#91
Merged
Billy99 merged 1 commit intoredhat-et:mainfrom Feb 6, 2026
Merged
Conversation
The finalizer was failing with "gkm.io/resolvedDigest is immutable when spec.image is unchanged" errors when Kyverno image verification was enabled. Root cause: The GKM mutating webhook was setting an empty digest annotation before Kyverno added the digest to spec.image, then attempting to update it when the controller added the finalizer, which violated the immutability check. Changes: - Add reinvocationPolicy: IfNeeded to mutating webhooks via Kustomize patch - Skip setting annotation when digest is empty in Kyverno mode - Update webhook README to document the patch-based approach The webhook now waits for Kyverno to mutate the image, gets reinvoked, and only then sets the annotation with the correct digest value. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Collaborator
Author
with new logs |
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.
The finalizer was failing with "gkm.io/resolvedDigest is immutable when spec.image is unchanged" errors when Kyverno image verification was enabled.
Root cause: The GKM mutating webhook was setting an empty digest annotation before Kyverno added the digest to spec.image, then attempting to update it when the controller added the finalizer, which violated the immutability check.
Changes:
The webhook now waits for Kyverno to mutate the image, gets reinvoked, and only then sets the annotation with the correct digest value.