-
Notifications
You must be signed in to change notification settings - Fork 332
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
Question: defining optional informers #2309
Comments
cc @mattmoor |
A workaround is to graph the shared informer factory and only get/start the informer if the resource is installed. I'd rather not make the Does that work? |
Not sure I understand what this would mean. Is opting out of sharedmain a baseline assumption here? |
No, the webhook goes through Lines 133 to 138 in 9179f78
If you access the informer this way, then you can make the informer optional, and guard it with some sort of environment check. If you'd want to make it so the resulting |
/close thanks! this makes sense |
@benmoss: Closing this 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 kubernetes/test-infra repository. |
/kind question
Expected Behavior
I'd like to define a controller that can work with 3rd party resources if they are installed in the cluster, but fallback to different or no behavior if they are not installed.
Actual Behavior
Right now using sharedmain /
EnableInformersOrDie
my controller gets stuck starting informers because the types are not resolvable.Additional Info
#2210 might be a solution, talked a little with @n3wscott about this.
An alternate solution might be to just have a way of starting an informer but declaring that it's okay to fail, and have some way to signal that failure to the controller so it can fallback to alternate behavior.
Another solution would be to push starting informers into user-land code so you could only try to start them if some check passes (ie
if resourceInstalled { startInformer }
)The text was updated successfully, but these errors were encountered: