This example Watches for Pod Events (e.g. Create / Update / Delete) and enqueues a reconcile.Request with the Name and Namespace of the Pod.
()
| 31 | // This example Watches for Pod Events (e.g. Create / Update / Delete) and enqueues a reconcile.Request |
| 32 | // with the Name and Namespace of the Pod. |
| 33 | func ExampleKind() { |
| 34 | err := ctrl.Watch(source.Kind(mgr.GetCache(), &corev1.Pod{}, &handler.TypedEnqueueRequestForObject[*corev1.Pod]{})) |
| 35 | if err != nil { |
| 36 | // handle it |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | // This example reads GenericEvents from a channel and enqueues a reconcile.Request containing the Name and Namespace |
| 41 | // provided by the event. |