kopf icon indicating copy to clipboard operation
kopf copied to clipboard

Changing the "from" name in the Kubernetes events

Open martinohansen opened this issue 2 years ago • 3 comments

Is it possible to change the "from" name that shows up in the Kubernetes events on a resource while using the kopf.Logging class? We are running multiple kopf operators and would like to know from which the messages are coming.

Events:
  Type    Reason      Age        From     Message
  ----    ------      ----       ----     -------
  Normal  Logging     2m20s      kopf     Handler 'roller' succeeded.

martinohansen avatar Jan 12 '23 14:01 martinohansen

I would like to know this too.

prestonr83 avatar May 18 '23 02:05 prestonr83

Its hard coded https://github.com/nolar/kopf/blob/c2664796a13bafab82fc2ed06855d959726734e3/kopf/_cogs/clients/events.py#L66 this would need to be parameterized to allow changing or you can fork and just statically change it.

prestonr83 avatar May 18 '23 15:05 prestonr83

I would also like to have this feature. Perhaps the PostingSettings could be extended with an additional option? The settings are passed to the post_event() function, so this should be easy to implement.

But: Can side effects occur if this option is parameterized? There will probably be a reason for the hard coding, right?

lorrx avatar Jan 03 '24 22:01 lorrx