After creating the owner CR, set `controllerutil.SetControllerReference(owner, child, scheme)` on each child object before creating it
Ensure the owner and child are in the same namespace for namespaced resources; cross-namespace owner references are not supported for garbage collection
Verify the `ownerReferences` field on a child with `kubectl get <child> -o yaml` after creation
Test deletion propagation by deleting the owner CR and confirming child resources are removed automatically
Use `metav1.DeletePropagationForeground` in integration tests to wait for children before the owner is fully removed
Known gotchas
Cluster-scoped resources cannot be owned by namespace-scoped resources; attempting this causes the API server to reject the owner reference
`SetControllerReference` panics if the owner object does not have a UID yet — always create the owner first and re-fetch before setting references on children
Multiple controllers setting owner references on the same object is not supported; only one `controller: true` owner reference is allowed per object
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp