gansheer commented on code in PR #4914:
URL: https://github.com/apache/camel-k/pull/4914#discussion_r1392570618


##########
pkg/install/operator.go:
##########
@@ -200,44 +199,6 @@ func OperatorOrCollect(ctx context.Context, cmd 
*cobra.Command, c client.Client,
                                        
envvar.SetVal(&d.Spec.Template.Spec.Containers[0].Env, "WATCH_NAMESPACE", "")
                                }
                        }
-
-                       // Turn Role & RoleBinding into their equivalent 
cluster types
-                       if r, ok := o.(*rbacv1.Role); ok {
-                               if strings.HasPrefix(r.Name, 
"camel-k-operator") {
-                                       o = &rbacv1.ClusterRole{
-                                               ObjectMeta: metav1.ObjectMeta{
-                                                       Namespace: 
cfg.Namespace,
-                                                       Name:      r.Name,
-                                                       Labels: 
map[string]string{
-                                                               "app": 
"camel-k",
-                                                       },
-                                               },
-                                               Rules: r.Rules,
-                                       }
-                               }
-                       }
-
-                       if rb, ok := o.(*rbacv1.RoleBinding); ok {
-                               if strings.HasPrefix(rb.Name, 
"camel-k-operator") {
-                                       rb.Subjects[0].Namespace = cfg.Namespace
-
-                                       o = &rbacv1.ClusterRoleBinding{
-                                               ObjectMeta: metav1.ObjectMeta{
-                                                       Namespace: 
cfg.Namespace,
-                                                       Name:      
fmt.Sprintf("%s-%s", rb.Name, cfg.Namespace),

Review Comment:
   @lburgazzoli @phantomjinx Do you know why the global cluster role bindings 
name are replaces with the namespace suffix ? 



##########
pkg/install/operator.go:
##########
@@ -200,44 +199,6 @@ func OperatorOrCollect(ctx context.Context, cmd 
*cobra.Command, c client.Client,
                                        
envvar.SetVal(&d.Spec.Template.Spec.Containers[0].Env, "WATCH_NAMESPACE", "")
                                }
                        }
-
-                       // Turn Role & RoleBinding into their equivalent 
cluster types
-                       if r, ok := o.(*rbacv1.Role); ok {
-                               if strings.HasPrefix(r.Name, 
"camel-k-operator") {
-                                       o = &rbacv1.ClusterRole{
-                                               ObjectMeta: metav1.ObjectMeta{
-                                                       Namespace: 
cfg.Namespace,
-                                                       Name:      r.Name,
-                                                       Labels: 
map[string]string{
-                                                               "app": 
"camel-k",
-                                                       },
-                                               },
-                                               Rules: r.Rules,
-                                       }
-                               }
-                       }
-
-                       if rb, ok := o.(*rbacv1.RoleBinding); ok {
-                               if strings.HasPrefix(rb.Name, 
"camel-k-operator") {
-                                       rb.Subjects[0].Namespace = cfg.Namespace
-
-                                       o = &rbacv1.ClusterRoleBinding{
-                                               ObjectMeta: metav1.ObjectMeta{
-                                                       Namespace: 
cfg.Namespace,
-                                                       Name:      
fmt.Sprintf("%s-%s", rb.Name, cfg.Namespace),

Review Comment:
   @lburgazzoli @phantomjinx Do you know why the global cluster role bindings 
name are tranformed with the namespace suffix ? 



-- 
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: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to