-
Notifications
You must be signed in to change notification settings - Fork 237
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
Replace the controller manager's RESTMapper with a dynamic one #95
Conversation
/lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danwinship, JacobTanenbaum, squeed 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 |
operator-framework/operator-sdk#1328 Essentially, using this fix: openshift/cluster-network-operator#95 But it really s/b fixed in o-sdk
* Delete custom cache setup, no longer necessary * Consolidate client usage and use dynamic discovery (see kubernetes-sigs/controller-runtime#321 — hat tip to @danwinship for openshift/cluster-network-operator#95). Fixes [bz1711373](https://bugzilla.redhat.com/show_bug.cgi?id=1711373). * Plumb the cache through for future use
controller-manager assumes that all resource Kinds will have been created before it starts up, so it can't deal with the case of creating a CRD and then creating an instance of that CRD (or waiting for another operator to create a CRD, and then creating an instance of that CRD). This is maybe not the bestest fix, but it works and we can discuss it further upstream.
Note that this code would be especially bad/inefficient if we thought that the controller was going to be repeatedly asked about objects of non-existent types, but there's no reason that would happen in CNO, so the reload path should only get hit in the creating-an-instance-of-a-previously-created-CRD case.