Skip to content

Specific resource instance as source #671

@raffaelespazzoli

Description

@raffaelespazzoli

I'd like to be able to easily create a source on a specific object rather than the whole kind.
So ideally I could write something like:

var obj runtime.Object
...
c.Watch(&source.Object{Object: obj},...)

the behavior should be that the most specific watcher would be created:

  • if namespaced type:
    • if neither namespace nor name are initialized, behave like source.Kind
    • if only namespace is initialized, create a watch for that type in that namespace
    • if both namespace and name are initialized, create a watch for that specific object
  • if not namespaced:
    • if name is not initialized behave like source.Kind
    • if name is initialized, create a watch for that specific object

this should work also with unstructured objects.

What is the best way to do this with the current controller-runtime library?

I haven't found a way to do it. It looks like the cache.informer interface does not allow for getting an informer on specific instances or namespace...

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/awaiting-more-evidenceLowest priority. Possibly useful, but not yet enough support to actually get it done.priority/backlogHigher priority than priority/awaiting-more-evidence.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions