Skip to content

Namespace for events whose involvedObject is cluster-scoped #781

Closed
@xinlaini

Description

Hello,
We have a CRD that's cluster-scoped, in its controller, we are trying to create relevant events related to this CR. Since Event itself is namespace-scoped, we have to set the namespace for the event when posting the create request. We have tried 3 options:

  1. setting event' namespace to our CRD controller's namespace (app-specific): this seems to be the most reasonable option, however, its rejected by the server due to "involved object's namespace does not match event.namespace":

  2. setting event's namespace to "", this arguably makes sense since our CRD is cluster-scope, and one could argue posting its related events against "" namespace is reasonable. However, this was rejected by the client-go request preflight validation

  3. setting event's namespace to "default", this works, however we feel uncomfortable because this doesn't seem to be as clean as 1 or 2.
    thoughts?
    Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions