-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Description
Describe the bug
Creating a PushSecret with DeletionPolicy == Delete, then later updating DeletionPolicy to None makes the PushSecret undeleteable.
To Reproduce
- Create a PushSecret with DeletionPolicy == Delete.
- Update the DeletionPolicy to None.
- Attempt to delete the PushSecret.
- The finalizer is never removed so deletion never takes place.
Expected behavior
The PushSecret is removed (almost) immediately.
I'm quite sure that the cause of the bug is here and in other similar switch statements.
Basically, when a PushSecret is created/updated with DeletionPolicy==Delete, the controller adds a finalizer. When the DeletionPolicy is updated to None, the finalizer is not removed. Finally, when a PushSecret with a DeletionPolicy of None is deleted, there is no code path to remove the finalizer, merely an empty switch case. Hence, the PushSecret can never be removed without user intervention.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.