ENTESB-18466 - Reworking of operator conditions ensuring step upgrades #9938
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.
While performing a double upgrade, ie. 1.13.0 -> 1.14.0 -> 1.14.1, the reconcile function was never being called and hence the operatorcondition for delaying the operator upgrade was never applied. To workaround this a new init-container is executed in front of the operator container that calls a partner binary (operator-init). This binary sits in the same operator image so no need to build another image (just override the command).
operator-init detects existence of a Syndesis resource, and if present, applies the operatorcondition. Since this is an init-container, the operator has not even started so no race conditions and guranteed that the next upgrade just cannot start ahead of the operatorcondition being set.
Only when the reconciled has correctly processed the operands, done the upgrade etc., is the operatorcondition released, allowing the next operator to kick in.
The visual manifestation of this is that the 1.14.1 operator appears in the list of operators but remains pending.