-
Notifications
You must be signed in to change notification settings - Fork 193
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
OTA-209: Add CVOConfiguration controller #1163
base: main
Are you sure you want to change the base?
OTA-209: Add CVOConfiguration controller #1163
Conversation
@DavidHurta: This pull request references OTA-209 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DavidHurta 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 |
The PR contains the manifests as of now as well. However, the manifests will be merged in #1161. Right now the PR contains them for testing purposes. I will drop the commits once the PR merges (or I suppose that the GitHub will start to ignore the commits). |
@DavidHurta: This pull request references OTA-209 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
Testing on a Default feature set:Everything as expected. No errors:
Manifests are excluded, go routine is not run:
DevPreviewNoUpgrade feature set:Errors are detected:
Most of the errors are expected. Otherwise, the controller is running as expected. Syncs are run every
|
/retest-required |
Make the CVO aware of a new feature gate called ClusterVersionOperatorConfiguration, which was introduced in [1]. [1]: openshift/api#2044
The controller has an empty reconcile logic as of now. The logic will be implemented later. The goal of this commit is to introduce a new CVO controller, which can optionally (depending on the state of the CVOConfiguration feature gate) create a new informer. The purpose of the `Start` method is to make the creation of a ClusterVersionOperator informer optional, and to make the creation possible later in the CVO logic by restarting the operator informer factory. To decide whether to create the informer, feature gates must be known, which happens normally later in the run when all the other informer factories are already created and inaccessible to the main CVO controller. Related enhancement: [1] [1]: https://github.com/openshift/enhancements/blob/2890cccf20ebcb94fce901f7afb170ca680aa2d9/enhancements/update/cvo-log-level-api.md
HyperShift will not create the ClusterVersionOperator CRD and CR. Thus, the relevant logic does not have to be running. Later, in HyperShift, we will configure the CVO to be configured via a configuration file instead.
a002d37
to
d09c388
Compare
/test e2e-agnostic-usc-devpreview |
/test e2e-agnostic-ovn |
if !config.started { | ||
panic("ClusterVersionOperatorConfiguration instance was not properly started before its synchronization.") | ||
} |
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.
So we recently had a case in USC where we used https://pkg.go.dev/sync#Once for a similar kind of initialization - first call to sync
performs an initialization through sync.Once
and then you do not need to do a check like this. Could we use a similar pattern here?
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.
Thanks, I'll have a look.
@@ -220,6 +229,7 @@ func (o *Options) run(ctx context.Context, controllerCtx *Context, lock resource | |||
controllerCtx.OpenshiftConfigInformerFactory.Start(informersDone) | |||
controllerCtx.OpenshiftConfigManagedInformerFactory.Start(informersDone) | |||
controllerCtx.InformerFactory.Start(informersDone) | |||
controllerCtx.OperatorInformerFactory.Start(informersDone) |
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.
Will this work on cluster without the CRD? 🤔
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.
Start
does not block and does not return anything. So the operation should be a no-op in such a cluster (as the code does not create any informers in such clusters).
If informers are created but no CRD for the informer is present on the cluster:
- Calling
WaitForCacheSync
on the factory will result in a permanently blocking operation as the caches are not able to sync. - Informers will start logging errors such as (see my previous comment)
E0224 16:25:40.333321 166921 reflector.go:166] "Unhandled Error" err="github.com/openshift/client-go/operator/informers/externalversions/factory.go:125: Failed to watch *v1alpha1.ClusterVersionOperator: failed to list *v1alpha1.ClusterVersionOperator: the server could not find the requested resource (get clusterversionoperators.operator.openshift.io)" logger="UnhandledError"
A good question as I am not sure how the code functions in case the operator
group itself does not exist yet (during an install).
@DavidHurta: The following tests failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
The controller has an empty reconciliation logic as of now.
The logic will be implemented in a follow-up PR. The goal of this PR is to introduce a new CVO controller, which can optionally (depending on the state of the
CVOConfiguration
feature gate) create a new informer.