openmcp-project / openmcp-project/controller-utils
Remove ConditionUpdater's 'removeUntouched' argument
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2
- Forks
- 4
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 9
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating ConditionUpdater and its callers in the controllers and tests, including uses in importing repositories. Remove the removeUntouched switch while preserving the behavior that keeps untouched conditions, then update affected callers and tests to confirm conditions such as C remain after updating A, B, and D.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100