We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents aca81e1 + 4053e38 commit 88179acCopy full SHA for 88179ac
docs/book/beyond_basics/controller_watches.md
@@ -9,7 +9,7 @@ Resources.
9
## Watching the Controller Resource
10
11
Controllers may watch Resources and trigger Reconcile calls with the key of the
12
-object from the watch event.
+object from the watch event.
13
14
This example configures a controller to watch for Pod events, and call Reconcile with
15
the Pod key.
@@ -32,6 +32,18 @@ if err != nil {
32
return err
33
}
34
```
35
+
36
+```go
37
+// You can also watch unstructured objects
38
+u := &unstructured.Unstructured{}
39
+u.SetGroupVersionKind(schema.GroupVersionKind{
40
+ Kind: "Pod",
41
+ Group: "",
42
+ Version: "v1",
43
+})
44
45
+err = c.Watch(&source.Kind{Type: u}, &handler.EnqueueRequestForObject{})
46
+```
47
{% endmethod %}
48
49
0 commit comments