Fix #2530: fix type and do not add cross-namespace owner references
diff --git a/pkg/trait/owner.go b/pkg/trait/owner.go
index c821e02..e6abc6d 100644
--- a/pkg/trait/owner.go
+++ b/pkg/trait/owner.go
@@ -78,17 +78,20 @@
 	}
 
 	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)
+		if res.GetNamespace() == "" || res.GetNamespace() == e.Integration.Namespace {
+			references := []metav1.OwnerReference{
+				{
+					APIVersion:         e.Integration.APIVersion,
+					Kind:               e.Integration.Kind,
+					Name:               e.Integration.Name,
+					UID:                e.Integration.UID,
+					Controller:         &controller,
+					BlockOwnerDeletion: &blockOwnerDeletion,
+				},
+			}
+			res.SetOwnerReferences(references)
 		}
-		res.SetOwnerReferences(references)
 
 		// Transfer annotations
 		t.propagateLabelAndAnnotations(res, targetLabels, targetAnnotations)
diff --git a/pkg/trait/pull_secret.go b/pkg/trait/pull_secret.go
index 115d601..b1612ce 100644
--- a/pkg/trait/pull_secret.go
+++ b/pkg/trait/pull_secret.go
@@ -122,6 +122,10 @@
 		serviceAccount = "default"
 	}
 	return &rbacv1.RoleBinding{
+		TypeMeta: metav1.TypeMeta{
+			Kind:       "RoleBinding",
+			APIVersion: rbacv1.SchemeGroupVersion.String(),
+		},
 		ObjectMeta: metav1.ObjectMeta{
 			Namespace: e.Integration.GetIntegrationKitNamespace(e.Platform),
 			Name:      fmt.Sprintf("camel-k-puller-%s", e.Integration.Namespace),