Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event recorder #55

Merged
merged 5 commits into from
Sep 19, 2018
Merged

Event recorder #55

merged 5 commits into from
Sep 19, 2018

Conversation

njuettner
Copy link
Contributor

@njuettner njuettner commented Sep 14, 2018

  • send custom events to Kubernetes to be recorded for targeted Kubernetes objects

Fix for #12

… targeted Kubernetes objects

Signed-off-by: Nick Jüttner <[email protected]>
Nick Jüttner added 2 commits September 14, 2018 17:14
Signed-off-by: Nick Jüttner <[email protected]>
… targeted Kubernetes objects

Signed-off-by: Nick Jüttner <[email protected]>
… targeted Kubernetes objects

Signed-off-by: Nick Jüttner <[email protected]>
@@ -157,7 +163,7 @@ func (c *StackSetController) Run(ctx context.Context) {
continue
}

c.logger.Infof("Adding entry for StackSet %s/%s", stackset.Namespace, stackset.Name)
c.recorder.Eventf(e.StackSet, apiv1.EventTypeNormal, "CreateStackSet", "StackSet '%s/%s' added", stackset.Namespace, stackset.Name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more internal logging for the controller. I think it's a bit confusing to log as an event as it will happen every time the controller restarts.

c.recorder.Eventf(stackset,
apiv1.EventTypeWarning,
"GetStackSet",
"Failed to get StackSet Object")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All events in add, update and delete are internal information for the controller. I think they are too "spammy" to log as events. They could potentially cause an event every time the controller is restarted.

Signed-off-by: Nick Jüttner <[email protected]>
kubernetes kubernetes.Interface
stackset stackset.Interface
kubernetes.Interface
stackset stackset.Interface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we drop stackset as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you mean? We can't do:

type x struct {
  kubernetes.Interface
  stackset.Interface
}

as the two Interface field names would overlap.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I meant, thanks.

@linki
Copy link
Member

linki commented Sep 19, 2018

👍

1 similar comment
@njuettner
Copy link
Contributor Author

👍

@njuettner njuettner merged commit 3bb43e5 into master Sep 19, 2018
@njuettner njuettner deleted the eventrecorder branch September 19, 2018 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants