-
Notifications
You must be signed in to change notification settings - Fork 3
Description
What would you like to be added:
Currently, the ConditionUpdater takes a bool argument that specifies whether 'untouched conditions' are kept or deleted. We don't need this switch anymore. Let's remove it to simplify the code base.
Example
Let's assume the old condition list contains three conditions, with the types A, B, and C.
If the bool is false, updating A, B, and D will result in the new condition list containing A, B, C, and D.
If the bool is true, updating A, B, and D instead results in the new condition list containing A, B, and D. The condition C is removed, because it has not been touched with the latest update operation.
Why is this needed:
When the ConditionUpdater was originally implemented, the desired behavior of conditions had not been discussed, therefore the library was built to support both options.
Lately, we have not only switched to the Condition type from the k8s.io/apimachinery/pkg/apis/meta/v1 package, which contains an ObservedGeneration field that allows to identify outdated conditions, but we also decided that we don't want old conditions to be removed. Supporting both options is therefore no longer necessary.
Note
There are various controllers and other coding (e.g. tests) that currently use the ConditionUpdater with the value set to true. Removing the option (by implicitly always setting it to false) will lead to some refactoring in importing repositories.