Skip to content

Commit

Permalink
chore(controller): knative service watch message
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Dec 21, 2023
1 parent d518d63 commit 02d38a7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/controller/integration/integration_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,16 @@ func add(ctx context.Context, mgr manager.Manager, c client.Client, r reconcile.
if ok, err = kubernetes.CheckPermission(checkCtx, c, serving.GroupName, "services", platform.GetOperatorWatchNamespace(), "", "watch"); err != nil {
return err
} else if ok {
log.Info("The operator has the privileges to watch KnativeService resources.")
b.Owns(&servingv1.Service{}, builder.WithPredicates(StatusChangedPredicate{}))
} else {
log.Info("The operator has not the privileges to watch KnativeService resources. Won't be able to work with Knative!")
}
} else {
log.Info(`
The cluster has no KnativeService resources installed at the moment. If you install Knative Serving later,
make sure to apply the required RBAC privileges and restart the operator in order to be able to watch Knative Services!
`)
}

return b.Complete(r)
Expand Down

0 comments on commit 02d38a7

Please sign in to comment.