Watching Created Resources

Controllers may watch Resources of types they create and trigger Reconcile calls with the key of
the Owner of the object.

This example configures a Controller to watch for Pod events, and call Reconcile with
the Owner ReplicaSet key. This is done by looking up the object referred to by the Owner reference
from the watch event object.

Define a function to lookup the Owner from the key

Call WatchControllerOf with the Owned object and the function to lookup the owner

If Pod default/foo-pod was created by ReplicaSet default/foo-rs, and the Pod is
(re)created, updated or deleted, then Reconcile will be called with namespace: default, name: foo-rs

Note: This requires adding the following annotations to your Controller struct to ensure the
correct RBAC rules are in place and informers have been started.

Watching Channels

Controllers may trigger Reconcile for events written to Channels. This is useful if the Controller
needs to trigger a Reconcile in response to something other than a create / update / delete event
to a Kubernetes object. Note: in most situations this case is better handled by updating a Kubernetes
object with the external state that would trigger the Reconcile.