Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENTESB-18466 - Reworking of operator conditions ensuring step upgrades #9938

Merged
merged 2 commits into from Apr 25, 2022

Conversation

phantomjinx
Copy link
Contributor

@phantomjinx phantomjinx commented Apr 25, 2022

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.

* Adds compile flags for removal of debug symbols from binaries
  reducing the size by ~15%
* A double upgrade (7.10 -> 7.11.0 -> 7.11.1) does not get to
  the point of running 7.11.0's Reconcile function before OLM
  kicks in upgrade to 7.11.1 so need to get the OLM
  operatorcondition applied before the pod has succeeded

* Adds an init-container operator-init to the operator deployment
 * Objective is find the CSV operatorcondition and disable upgrading
 * container runs the operator image but has command operator-init
   instead of operator binary
 * Operator-init binary compiled in addition to syndesis-operator

* Adds ProductName var to deployment template as required for
  finding the operatorcondition

* syndesis_controller.go
 * Adds in disable states to start of Reconcile function to
   handle non-resource use-cases

* .../action/...
 * To allow for operator-init binary to use operatorcondition
   API, have the productName passed in as a parameter
@zregvart
Copy link
Member

retest this please

@phantomjinx phantomjinx merged commit 7321d5b into syndesisio:1.14.x Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/l Large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants