Skip to content

Instantly share code, notes, and snippets.

@slok
Last active February 15, 2018 15:03
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/decf0e81fba3023e33e977dc8f5bdb51 to your computer and use it in GitHub Desktop.
Save slok/decf0e81fba3023e33e977dc8f5bdb51 to your computer and use it in GitHub Desktop.
// Create our retriever so the controller knows how to get/listen for pod events.
retr := &retrieve.Resource{
Object: &corev1.Pod{},
ListerWatcher: &cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
return k8scli.CoreV1().Pods("").List(options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
return k8scli.CoreV1().Pods("").Watch(options)
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment