This is an automated email from the ASF dual-hosted git repository.
squakez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new 6ef772c6f fix(ctrl): knative service watch rbac
6ef772c6f is described below
commit 6ef772c6f9b9115a22c4f2eb76f728f40dd982d8
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Thu Jun 4 08:35:23 2026 +0200
fix(ctrl): knative service watch rbac
---
pkg/controller/integration/integration_controller.go | 13 +++++++------
.../config/rbac/descoped/operator-cluster-role-knative.yaml | 4 +---
.../config/rbac/namespaced/operator-role-knative.yaml | 1 +
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/pkg/controller/integration/integration_controller.go
b/pkg/controller/integration/integration_controller.go
index 77ef05e50..612d30675 100644
--- a/pkg/controller/integration/integration_controller.go
+++ b/pkg/controller/integration/integration_controller.go
@@ -435,9 +435,9 @@ func watchKnativeResources(ctx context.Context, c
client.Client, b *builder.Buil
return err
}
if !ok {
- log.Info(`KnativeService resources are not installed in the
cluster. You can't use Knative features. If you install Knative Serving
resources after the
- Camel K operator, make sure to apply the required RBAC
privileges and restart the Camel K Operator Pod to be able to watch for
- Camel K managed Knative Services.`)
+ log.Info("KnativeService resources are not installed in the
cluster. You can't use Knative serving features. " +
+ "If you install Knative Serving resources after the
Camel K operator, make sure to apply the required RBAC privileges " +
+ "and restart the Camel K Operator Pod to be able to
watch for Camel K managed Knative Services.")
return nil
}
@@ -448,11 +448,12 @@ func watchKnativeResources(ctx context.Context, c
client.Client, b *builder.Buil
if ok, err = kubernetes.CheckSelfPermission(checkCtx, c,
serving.GroupName, "services", platform.GetOperatorWatchNamespace(), "",
"watch"); err != nil {
return err
} else if ok {
- log.Info("KnativeService resources installed in the cluster.
RBAC privileges assigned correctly, you can use Knative features.")
+ log.Info("KnativeService resources installed in the cluster.
RBAC privileges assigned correctly, you can use Knative serving features.")
b.Owns(&servingv1.Service{},
builder.WithPredicates(StatusChangedPredicate{}))
} else {
- log.Info(` KnativeService resources installed in the cluster.
However Camel K operator has not the required RBAC privileges. You can't use
Knative features.
- Make sure to apply the required RBAC privileges
and restart the Camel K Operator Pod to be able to watch for Camel K managed
Knative Services.`)
+ log.Info("KnativeService resources installed in the cluster.
However Camel K operator has not the required RBAC privileges. " +
+ "You can't use Knative features.Make sure to apply the
required RBAC privileges and restart the Camel K Operator Pod to be able " +
+ "to watch for Camel K managed Knative Services.")
}
return nil
diff --git
a/pkg/resources/config/rbac/descoped/operator-cluster-role-knative.yaml
b/pkg/resources/config/rbac/descoped/operator-cluster-role-knative.yaml
index f25ccc8d1..4130af3e7 100644
--- a/pkg/resources/config/rbac/descoped/operator-cluster-role-knative.yaml
+++ b/pkg/resources/config/rbac/descoped/operator-cluster-role-knative.yaml
@@ -33,8 +33,7 @@ rules:
- get
- list
- patch
- # - update
- # - watch
+ - watch
- apiGroups:
- eventing.knative.dev
resources:
@@ -46,7 +45,6 @@ rules:
- get
- list
- patch
- # - update
- apiGroups:
- messaging.knative.dev
resources:
diff --git a/pkg/resources/config/rbac/namespaced/operator-role-knative.yaml
b/pkg/resources/config/rbac/namespaced/operator-role-knative.yaml
index 02ef24268..e2c5f7331 100644
--- a/pkg/resources/config/rbac/namespaced/operator-role-knative.yaml
+++ b/pkg/resources/config/rbac/namespaced/operator-role-knative.yaml
@@ -33,6 +33,7 @@ rules:
- get
- list
- patch
+ - watch
- apiGroups:
- eventing.knative.dev
resources: