christophd commented on code in PR #3358:
URL: https://github.com/apache/camel-k/pull/3358#discussion_r913231243


##########
pkg/trait/platform.go:
##########
@@ -122,14 +130,17 @@ func (t *platformTrait) getOrCreatePlatform(e 
*Environment) (*v1.IntegrationPlat
                        }
                        
defaultPlatform.Labels["camel.apache.org/platform.generated"] = True
                        // Cascade the operator id in charge to reconcile the 
Integration
-                       if e.Integration.Annotations != nil && 
e.Integration.Annotations[v1.OperatorIDAnnotation] != "" {
-                               if defaultPlatform.Annotations == nil {
-                                       defaultPlatform.Annotations = 
make(map[string]string)
-                               }
-                               
defaultPlatform.Annotations[v1.OperatorIDAnnotation] = 
e.Integration.Annotations[v1.OperatorIDAnnotation]
+                       if v1.GetOperatorIDAnnotation(e.Integration) != "" {
+                               
defaultPlatform.SetOperatorID(v1.GetOperatorIDAnnotation(e.Integration))
                        }
                        pl = &defaultPlatform
                        e.Resources.Add(pl)
+
+                       // Make sure that IntegrationPlatform installed in 
operator namespace can be seen by others
+                       if err := install.IntegrationPlatformViewerRole(e.Ctx, 
t.Client, namespace); err != nil && !k8serrors.IsAlreadyExists(err) {

Review Comment:
   The viewer role is bound to the namespace where the integration platform is 
living. so I think it makes sense to do this right after the integration 
platform has been created. following from that I see this in both the 
integration platform trait and the operator optional tools install mechanism.



-- 
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