Conversation
Adding the robotlb finalizer used a JSON merge patch that set metadata.finalizers to a one-element list. A merge patch replaces a list as a whole, so every finalizer another controller had put on the Service was dropped. Removal wrote back the list read from the cache, so a finalizer added or removed in between was lost or came back. metadata.finalizers is merged by value in a strategic merge patch, so adding now appends only robotlb's entry and removal deletes only that entry with a deleteFromPrimitiveList directive. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>
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.
Adding and removing the robotlb finalizer no longer touches finalizers of other controllers.
Adding used a JSON merge patch that set
metadata.finalizersto a one-element list, and a merge patch replaces a list as a whole. Removal wrote back the list read from the cache, so a finalizer added or removed in between was lost or came back. Both now use a strategic merge patch, wheremetadata.finalizersis merged by value. Adding appends robotlb's entry, and removal deletes it with$deleteFromPrimitiveList.I checked both patches on a kind cluster, with another finalizer already on a Service. The new add left
["robotlb/finalizer","example.com/other"]and the removal left["example.com/other"]. The old merge patch left only robotlb's. The tests pin the patch type, so going back to a merge patch fails them.Closes #40