astefanutti commented on a change in pull request #2535:
URL: https://github.com/apache/camel-k/pull/2535#discussion_r678995232



##########
File path: pkg/trait/owner.go
##########
@@ -78,17 +78,20 @@ func (t *ownerTrait) Apply(e *Environment) error {
        }
 
        e.Resources.VisitMetaObject(func(res metav1.Object) {
-               references := []metav1.OwnerReference{
-                       {
-                               APIVersion:         e.Integration.APIVersion,
-                               Kind:               e.Integration.Kind,
-                               Name:               e.Integration.Name,
-                               UID:                e.Integration.UID,
-                               Controller:         &controller,
-                               BlockOwnerDeletion: &blockOwnerDeletion,
-                       },
+               // Avoid setting owner references across namespaces (resources 
are asynchronously refused by the api server)

Review comment:
       Yes I agree. The controller-runtime util package has some helpers that 
do some pre-flight checks client-side when updating the owner references to 
prevent invalid references before applying them server-side. That tends to 
confirm they are not reported synchronously by the API server. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to