-
Notifications
You must be signed in to change notification settings - Fork 66
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
[release-4.8] WINC-571: [wmco] Prevent OLM upgrades when operator is busy #759
[release-4.8] WINC-571: [wmco] Prevent OLM upgrades when operator is busy #759
Conversation
@saifshaikh48: No Bugzilla bug is referenced in the title of this pull request. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
This commit introduces a new time limit to wait for changes upon to resources to take effect. This applies to resource creation, deletion & updates/patches. Patching the operator's Upgradeable condition can take longer to so a longer retry timeout is chosen rather than erroring out too quickly. (cherry picked from commit 1dc44ab)
This commit introduces constants that denote the name of each controller. These names are used in log messages, events, and other outputs. (cherry picked from commit 2c1f115)
This commit introduces the reporting of operator conditions back to OLM. Specifically, the `Upgradeable` condition is set to `False` when WMCO is processing any child components (Windows nodes, private key secret, CSRs), blocking OLM from replacing the operator CSV during this time. The `Upgradeable` condition is set back to `True` when no processing is currently ongoing, meaning that all controllers: - reconciled without error - did not request a requeue If there is at least one busy controller, operator cannot be upgraded (Upgradeable condition set to False), preventing unsafe updates. A mutex lock is maintained to secure access to the busy controllers set and the patching of the OperatorCondition resource. This ensures smooth transitions from one EUS version of OpenShift to another. A warning event is sent off when there is a failure getting or patching the OperatorCodnition resource. The event serves to alert users, as such failures can block WMCO controllers from executing reconcile steps (as recommended by OLM). A recorder was added to the secret reconciler struct to bring it in line with the other reconcilers. (cherry picked from commit 3fa7419)
This commit tests the operator's ability to communicate to OLM that it is currently not interruptable for upgrade. Checks are added to ensure the oeprator's Upgradeable condition is False when it is processing any sub-components, and reset to True when it is not reconciling/safe for upgrade. (cherry picked from commit f57effd)
Ran: - `go get "github.com/operator-framework/api/pkg/operators/v2"` - `go mod vendor && go mod tidy`
5dd079e
to
d35e2c4
Compare
/lgtm |
@saifshaikh48: you cannot LGTM your own PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aravindhp, saifshaikh48 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Manual backport of #618 due to vendoring conflict.