Skip to content

Commit

Permalink
Fix global test
Browse files Browse the repository at this point in the history
  • Loading branch information
gansheer committed Nov 13, 2023
1 parent 5e98c29 commit 8cb24ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions e2e/support/test_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,7 @@ func CreateOperatorRole(ns string) (err error) {
// This should ideally be removed from the common RBAC manifest.
customizer = install.RemoveIngressRoleCustomizer
}
err = install.Resource(TestContext, TestClient(), ns, true, customizer, "/rbac/operator-role.yaml")
err = install.Resource(TestContext, TestClient(), ns, true, customizer, "/rbac/namespaced/operator-role.yaml")
if err != nil {
return err
}
Expand All @@ -2390,7 +2390,7 @@ func CreateOperatorRoleBinding(ns string) error {
if err != nil {
failTest(err)
}
err = install.Resource(TestContext, TestClient(), ns, true, install.IdentityResourceCustomizer, "/rbac/operator-role-binding.yaml")
err = install.Resource(TestContext, TestClient(), ns, true, install.IdentityResourceCustomizer, "/rbac/namespaced/operator-role-binding.yaml")
if err != nil {
return err
}
Expand Down
9 changes: 4 additions & 5 deletions pkg/install/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"context"
"errors"
"fmt"
"strings"

"github.com/spf13/cobra"

Expand Down Expand Up @@ -202,7 +201,7 @@ func OperatorOrCollect(ctx context.Context, cmd *cobra.Command, c client.Client,
}

// Turn Role & RoleBinding into their equivalent cluster types
if r, ok := o.(*rbacv1.Role); ok {
/*if r, ok := o.(*rbacv1.Role); ok {
if strings.HasPrefix(r.Name, "camel-k-operator") {
o = &rbacv1.ClusterRole{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -215,9 +214,9 @@ func OperatorOrCollect(ctx context.Context, cmd *cobra.Command, c client.Client,
Rules: r.Rules,
}
}
}
}*/

if rb, ok := o.(*rbacv1.RoleBinding); ok {
/*if rb, ok := o.(*rbacv1.RoleBinding); ok {
if strings.HasPrefix(rb.Name, "camel-k-operator") {
rb.Subjects[0].Namespace = cfg.Namespace
Expand All @@ -237,7 +236,7 @@ func OperatorOrCollect(ctx context.Context, cmd *cobra.Command, c client.Client,
},
}
}
}
}*/
}

if isOpenShift {
Expand Down

0 comments on commit 8cb24ae

Please sign in to comment.