Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Use of EventRecorder? #63

Open
christopherL91 opened this issue Jul 9, 2018 · 2 comments
Open

Use of EventRecorder? #63

christopherL91 opened this issue Jul 9, 2018 · 2 comments

Comments

@christopherL91
Copy link

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.

@enisoc
Copy link

enisoc commented Jul 9, 2018

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.

@christopherL91
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants