kopf
kopf copied to clipboard
Changing the "from" name in the Kubernetes events
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.
I would like to know this too.
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.
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?