Skip to content

[question] how to watch for a CRD in any namespace? #1337

Description

@lknite

I'm able to use WatchNamespacedAsync on a generic, to watch a specific namespace, with the understanding that WatchAsync is watching the default namespace, but what if I want to watch for a CRD which may appear in any namespace?

Current code watches one namespace:

await foreach (var (type, item) in generic.WatchNamespacedAsync<CrdMyCrd>("namespace_here"))
{
    Console.WriteLine("");
    Console.WriteLine("(event) [" + type + "] " + plural + "." + group + "/" + version + ": " + item.Metadata.Name);

Is this possible without creating multiple listens (one to watch each namespace)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions