-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Operator panics if it starts before creating the CRD #183
Comments
Would it be appropriate for the operator to register/manage the CRD spec internally instead of applying it externally? Similarly to what the prometheus operator is doing -- https://github.com/coreos/prometheus-operator/blob/72b2e6847dec58269dfe4950097344155f8bc6cf/pkg/alertmanager/operator.go#L536-L562 |
@bradbeam This won't always work in production use cases because installing the CRD requires cluster-level permissions, but running the operator in a namespace only requires permissions in that namespace. Some installations will require the CRD to be installed by a more privileged user than the person who is actually using the operator. |
It can be a under a flag that you can enable in case you want to make the framework generate it automatically |
Operator should exit with an obvious error message if it can't find the CRD. |
*What* * indefinitely retry to get a resource client in the watch call * add a mutex to save the `informers` global from concurrent access * move informer setup into own go-routine *Why* * until now all operators will die when they are deployed before their CRD they are managing * `informers` is a global variable in the sdk package. To make it safe for concurrent use it's now guarded by an mutex * this fixes operator-framework#183
*What* * indefinitely retry to get a resource client in the watch call * add a mutex to save the `informers` global from concurrent access * move informer setup into own go-routine *Why* * until now all operators will die when they are deployed before their CRD they are managing * `informers` is a global variable in the sdk package. To make it safe for concurrent use it's now guarded by an mutex fixes operator-framework#183
I believe that the controller runtime prints this out:
Do people think this is sufficient? |
@shawn-hurley That looks clear enough to me. I think we can close this and get back to it if some user in the future doesn't find it clear enough. 👍 Unless someone has other ideas? |
Yeah I think this is clear enough. |
…-master Bug 2029645: Merge upstream tag v1.15.0
When deploying the operator image built by operator-sdk, if the deployment of the operator image happens before the creation of the CRD the operator panics.
Reproducible steps:
Because the operator deployment has a default
restartPolicy: Always
, the operator will be re-started until the CRD is created. Hence, the operator will still work as usual.Potential fix:
The operator should wait until the crd is created before proceeding.
The text was updated successfully, but these errors were encountered: