Skip to content

Watcher does not support Unstructured objects #422

@crimsonfaith91

Description

@crimsonfaith91

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 for Unstructured objects.

For example,

err = controller.Watch(&source.Kind{Type: someUnstructuredResource.DeepCopyObject()}, &handler.EnqueueRequestForOwner{
	IsController: true,
	OwnerType:    &operatorv1alpha1.SomeOwnerResource{},
})

.DeepCopyObject() is a generated function returning a runtime.Object. When I modify an instance of someUnstructuredResource, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions