This is an automated email from the ASF dual-hosted git repository.

pcongiusti 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 c6784bbec chore(cmd): don't warn if rolebinding exists
c6784bbec is described below

commit c6784bbec7d0174b37769ee7141a60567abf5a6a
Author: Pasquale Congiusti <pasquale.congiu...@gmail.com>
AuthorDate: Thu Apr 13 16:03:46 2023 +0200

    chore(cmd): don't warn if rolebinding exists
---
 pkg/install/operator.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pkg/install/operator.go b/pkg/install/operator.go
index 14f99fa0a..96adaf885 100644
--- a/pkg/install/operator.go
+++ b/pkg/install/operator.go
@@ -345,7 +345,9 @@ func OperatorOrCollect(ctx context.Context, cmd 
*cobra.Command, c client.Client,
        }
 
        if err = installNamespacedRoleBinding(ctx, c, collection, 
cfg.Namespace, "/rbac/operator-role-binding-local-registry.yaml"); err != nil {
-               fmt.Fprintf(cmd.ErrOrStderr(), "Warning: the operator may not 
be able to detect a local image registry (%s)\n", err.Error())
+               if !k8serrors.IsAlreadyExists(err) {
+                       fmt.Fprintf(cmd.ErrOrStderr(), "Warning: the operator 
may not be able to detect a local image registry (%s)\n", err.Error())
+               }
        }
 
        if cfg.Monitoring.Enabled {

Reply via email to