Reputation: 27025
I write a Kubernetes controller with controller-runtime.
Imagine there are three CRDs: GrandPa
, Son
, and GrandSon
. Each has its own controller in a separate deployment.
I am writing the GrandPa
controller. When the user creates a GrandPa
object, my controller creates a Son
object and uses SetControllerReference(grandpa, son)
.
The Son
controller detects the new Son
object, creates a GrandSon
object, and uses SetControllerReference(son, grandson)
.
My GrandPa
controller needs its Reconcile()
function to be triggered when a GrandSon
object changes.
Afaik .Owns()
does not work for GrandPa
watching GrandSon
because the ownership chain is indirect (GrandPa -> Son -> GrandSon
).
I can only change the source code of GrandPa controller.
How to get Reconcile() of GrandPa get triggered when GrandSon changes?
Upvotes: -7
Views: 59