Skip to content

Consider executing "reconcileDelete" only if finalizer is set #11399

Open
@sbueringer

Description

@sbueringer

Today our controllers are implemented like this:

  • if object has no deletionTimestamp
    • => Ensure finalizer is set
  • else
    • => execute "reconcileDelete" (remove finalizer at the end of reconcileDelete)

In later reconciles we continue to run "reconcileDelete" even if the finalizer is not set anymore.

I wonder if this should be changed to only execute reconcileDelete as long as the finalizer is on the object.

Pro: always running reconcileDelete:

  • reconcileDelete code will always make sure everything is deleted even if the finalizer is not set (but this also means that the object could be removed from etcd in the middle of reconcileDelete)

Pro: running reconcileDelete only when finalizer is set:

  • reconcileDelete will only be executed until the finalizer has been removed
    • Example: Machine deletion will stop executing reconcileDelete as soon as it completed successfully once (so we stop continuously trying to drain Pods, waiting for volume detach , ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.priority/backlogHigher priority than priority/awaiting-more-evidence.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions