MCPcopy
hub / github.com/kubernetes-sigs/controller-runtime / ExampleKind

Function ExampleKind

pkg/source/example_test.go:33–38  ·  view source on GitHub ↗

This example Watches for Pod Events (e.g. Create / Update / Delete) and enqueues a reconcile.Request with the Name and Namespace of the Pod.

()

Source from the content-addressed store, hash-verified

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.
33func 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.

Callers

nothing calls this directly

Calls 3

KindFunction · 0.92
WatchMethod · 0.65
GetCacheMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…