Skip to content

Commit 8c68745

Browse files
authored
improve structure of finalizer section in CRD guide (#24851)
- It's now more precise regarding the format of finalizers (which have to consist of a namespace and a name, separated by a forward slash or they will get rejected by the apiserver, with the exception of built in ones) - It's less repetitve in general
1 parent 0b222bd commit 8c68745

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

content/en/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -518,27 +518,25 @@ apiVersion: "stable.example.com/v1"
518518
kind: CronTab
519519
metadata:
520520
finalizers:
521-
- finalizer.stable.example.com
521+
- stable.example.com/finalizer
522522
```
523523

524-
Finalizers are arbitrary string values, that when present ensure that a hard delete
525-
of a resource is not possible while they exist.
524+
Identifiers of custom finalizers consist of a domain name, a forward slash and the name of
525+
the finalizer. Any controller can add a finalizer to any object's list of finalizers.
526526

527527
The first delete request on an object with finalizers sets a value for the
528528
`metadata.deletionTimestamp` field but does not delete it. Once this value is set,
529-
entries in the `finalizers` list can only be removed.
529+
entries in the `finalizers` list can only be removed. While any finalizers remain it is also
530+
impossible to force the deletion of an object.
530531

531-
When the `metadata.deletionTimestamp` field is set, controllers watching the object
532-
execute any finalizers they handle, by polling update requests for that
533-
object. When all finalizers have been executed, the resource is deleted.
532+
When the `metadata.deletionTimestamp` field is set, controllers watching the object execute any
533+
finalizers they handle and remove the finalizer from the list after they are done. It is the
534+
responsibility of each controller to remove its finalizer from the list.
534535

535-
The value of `metadata.deletionGracePeriodSeconds` controls the interval between
536-
polling updates.
536+
The value of `metadata.deletionGracePeriodSeconds` controls the interval between polling updates.
537537

538-
It is the responsibility of each controller to remove its finalizer from the list.
539-
540-
Kubernetes only finally deletes the object if the list of finalizers is empty,
541-
meaning all finalizers have been executed.
538+
Once the list of finalizers is empty, meaning all finalizers have been executed, the resource is
539+
deleted by Kubernetes.
542540

543541
### Validation
544542

0 commit comments

Comments
 (0)