Skip to content

finalizer,metaapply: manage finalizers with server-side apply - #95

Merged
vroldanbet merged 1 commit into
authzed:mainfrom
ecordell:evan/finalizer-apply
Nov 9, 2026
Merged

vroldanbet merged 1 commit into
authzed:mainfrom
ecordell:evan/finalizer-apply

Conversation

@ecordell

@ecordell ecordell commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor
  • metaapply applies metadata to an existing object. Each apply includes the uid, so it cannot create an object or change a replacement object. It returns ErrOwnsNonMetadata if its field manager owns fields outside metadata.
  • finalizer.Finalizer uses metaapply to add and remove one finalizer. Its field manager is finalizer:<name>.
  • Finalizer.Remove applies first. An apply cannot remove a finalizer that a different manager also owns. In this case, Remove uses a JSON patch that tests the uid and the entry. GetAddFunc finalizers go through this path.
  • SetFinalizerHandler uses ApplyFinalizer if it is set. Its AddFinalizer field, GetAddFunc, and GetRemoveFunc are deprecated.

@ecordell
ecordell force-pushed the evan/finalizer-apply branch 2 times, most recently from 8b01524 to cca0eb0 Compare November 9, 2026 13:59
@ecordell
ecordell marked this pull request as ready for review November 9, 2026 14:01
@ecordell
ecordell enabled auto-merge November 9, 2026 14:23
Comment thread finalizer/set_finalizer.go Resolved
@ecordell
ecordell force-pushed the evan/finalizer-apply branch from cca0eb0 to 7b36cfe Compare November 9, 2026 15:20
vroldanbet
vroldanbet previously approved these changes Nov 9, 2026
metaapply applies metadata to an existing object. Each apply includes
the uid, so it cannot create an object. Each Applier has its own field
manager.

finalizer.Finalizer uses metaapply to add and remove one finalizer. An
apply cannot remove a finalizer that a different manager also owns. In
this case, Remove uses a JSON patch.

SetFinalizerHandler uses ApplyFinalizer if it is set. Its AddFinalizer
field, GetAddFunc, and GetRemoveFunc are deprecated.
@vroldanbet
vroldanbet disabled auto-merge November 9, 2026 15:26
@vroldanbet
vroldanbet merged commit 7cb9d74 into authzed:main Nov 9, 2026
6 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants