astefanutti commented on code in PR #3400:
URL: https://github.com/apache/camel-k/pull/3400#discussion_r910699865
##########
pkg/install/knative.go:
##########
@@ -32,45 +32,45 @@ import (
const knativeAddressableResolverClusterRoleName = "addressable-resolver"
-// BindKnativeAddressableResolverClusterRole binds the Knative Addressable
resolver aggregated ClusterRole
+// BindKnativeAddressableResolverClusterRole binds the Knative addressable
resolver aggregated ClusterRole
// to the operator ServiceAccount.
-func BindKnativeAddressableResolverClusterRole(ctx context.Context, c
kubernetes.Interface, namespace string) error {
+func BindKnativeAddressableResolverClusterRole(ctx context.Context, c
kubernetes.Interface, global bool, operatorNamespace string) error {
if isKnative, err := knative.IsInstalled(ctx, c); err != nil {
return err
} else if !isKnative {
return nil
}
- if namespace != "" {
- return applyAddressableResolverRoleBinding(ctx, c, namespace)
+ if global {
+ return applyAddressableResolverClusterRoleBinding(ctx, c,
operatorNamespace)
}
- return applyAddressableResolverClusterRoleBinding(ctx, c, namespace)
+ return applyAddressableResolverRoleBinding(ctx, c, operatorNamespace)
}
-func applyAddressableResolverRoleBinding(ctx context.Context, c
kubernetes.Interface, namespace string) error {
- rb := rbacv1ac.RoleBinding(fmt.Sprintf("%s-addressable-resolver",
serviceAccountName), namespace).
+func applyAddressableResolverRoleBinding(ctx context.Context, c
kubernetes.Interface, operatorNamespace string) error {
+ rb := rbacv1ac.RoleBinding(fmt.Sprintf("%s-addressable-resolver",
serviceAccountName), operatorNamespace).
Review Comment:
I realise I may have introduced the confusion in the first place, but I'm
not sure this is going to work when the WATCH_NAMESPACE is different from the
operator namespace. Is it? If not, we'll have to keep the WATCH_NAMESPACE
argument.
--
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]