Use of EventRecorder?
Fantastic piece of software you guys have written! I’m actually considering using this to implement a custom operator instead of writing it from scratch in go for my masters thesis!
Have you considered implementing a way of using the EventRecorder from a webhook? That way, a user could log custom events to the crd. It could be as simple as adding a new field from the output and run the emit function on whatever you return back I suppose.
Great idea! I thought about something like this but figured I would prioritize emitting events automatically first (#7). Metacontroller knows enough to emit things like: sync hook error, create/update/delete child object, rolling update started/finished, etc.
Do you have examples of events that you'd want to emit manually as part of the webhook response? It would be useful to see the types of things that could only be done if we add this manual interface.
Hi @enisoc sorry for not coming back to you. I had this particular function in mind:
https://github.com/kubernetes/client-go/blob/master/tools/record/event.go#L294-L296
So an idea is to let the user specify events to be logged by applying an extra field that the user returns in the response.
Example:
{
"events": {
"warnings": [
{"timestamp": "2009-11-10T23:00:00Z", "message": "hello world"}
]
},
"status": {},
"children": {}
}
By using the PastEventf we could generate events that has 'already happened'. But if you sync say every 10s this becomes a minor issue.