-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Watcher does not support Unstructured objects #422
Comments
@shawn-hurley Can you pl. here since your are the most familiar with unstructured codebase. |
@droot will take a look either today or tomorrow. I am personally using watches with unstructured objects right now. I wonder if you are setting the GVK for the unstructured object? |
@shawn-hurley Yes. I am able to obtain the GVK through Btw, are you setting the watcher by specifying
I currently register the watcher within the sync loop ( |
So it sounds like you are attempting to call I am seeing the same blocking behavior if I use unstructured or This will not work for any scenario, unstructured or otherwise AFAIK. @droot @DirectXMan12 can you verify that is the case? |
Correct. we just verified that from the code. Taking a deep look at it to see how we can support this use-case. |
@droot @shawn-hurley Sorry for not making it clearer in my previous comment. I am aware of What I want to achieve is the ability to watch an object with dynamic type. I debugged by temporarily un-comment the mutex codes of |
I mocked a dummy I speculate that various components of Kubebuilder (not just the watcher) requires For now, I reduce resync period to have the change of I now think this may be more of a feature request than a bug. |
Pretty much any type you want to work with has to be registered with discovery. If a given resource is not available in discovery, we can't work with it. It doesn't necessarily need to be registered in the scheme, but if you can't find it at the |
@DirectXMan12 Oops, this problem has resolved. I will close it now. To fix the problem, it requires adding the scheme dynamically apart from this change. |
I spent a full day working on getting the watcher works for
Unstructured
objects, but failed to do any progress, so I deduce the watcher does not work forUnstructured
objects.For example,
.DeepCopyObject()
is a generated function returning aruntime.Object
. When I modify an instance ofsomeUnstructuredResource
, the sync loop is not triggered.To verify watcher does not work, I change
someUnstructuredResource.DeepCopyObject()
to&corev1.Pod{}
and modify the pod. The sync loop is triggered.@pwittrock
@droot
The text was updated successfully, but these errors were encountered: