Skip to content

Where finalizers should be set? #2760

Closed Answered by FillZpp
Segflow asked this question in Support
Discussion options

You must be logged in to vote

@Segflow There can be always two places to update a resource object, in controller reconcile or in mutating webhook. My suggestion is, do it in controller reconcile as much as possible, unless the object has to be modified during its request to APIServer.

So back to your question, it depends on what you want to do with the finalizers.

  1. If the object should be protected once it created so that it can be reconciled to do something cleanup when it has been deleted, you should set the finalizer in mutating webhook.
  2. If the object has no need to be protected once it created, but only needs to block deletion after it is reconciled and has some cleanup to do, you should set the finalizer in your …

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Segflow
Comment options

You must be logged in to vote
1 reply
@FillZpp
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
3 participants