Correct and optimize reconciliation on deletion #622
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
While testing something, I noticed that deleting a build caused a reconciliation on the build:
That caused me to look into the reconciliations on delete. For Builds, I simply always return false in the predicate function because there is nothing we need to do when a Build is deleted since we do not have any finalizers.
The same applies for BuildRuns.
For TaskRuns, I am fixing a bug. When a TaskRun got deleted, we unconditionally changed the BuildRun to Failed state stating that the TaskRun doesn't exist. This imo makes sense as long as the TaskRun is not completed, but if the TaskRun is completed, then we also updated the BuildRun to a (final) Success or Failed state already for the Update event. I am therefore only reconciling on TaskRun deletion when the CompletionTime is
nil
. Also added integration tests.Submitter Checklist
Release Notes