Skip to content

Instantly share code, notes, and snippets.

@slok
Created February 15, 2018 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slok/e585bb5c7b43c1ee0833e5db50bb7ba2 to your computer and use it in GitHub Desktop.
Save slok/e585bb5c7b43c1ee0833e5db50bb7ba2 to your computer and use it in GitHub Desktop.
// Our domain logic that will print every add/sync/update and delete event we .
hand := &handler.HandlerFunc{
AddFunc: func(obj runtime.Object) error {
pod := obj.(*corev1.Pod)
log.Infof("Pod Add event: %s/%s", pod.Namespace, pod.Name)
return nil
},
DeleteFunc: func(s string) error {
log.Infof("Pod Delete event: %s", s)
return nil
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment