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

tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 45a79a39d7dcadb1f6bbab977d37e8950815cd6b
Author: Tadayoshi Sato <[email protected]>
AuthorDate: Tue Oct 5 16:46:14 2021 +0900

    chore(cli): more friendly error message in case of kamel install failure
---
 pkg/install/operator.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pkg/install/operator.go b/pkg/install/operator.go
index c8ea505..3003cfc 100644
--- a/pkg/install/operator.go
+++ b/pkg/install/operator.go
@@ -301,7 +301,11 @@ func installClusterRoleBinding(ctx context.Context, c 
client.Client, collection
        existing, err := c.RbacV1().ClusterRoleBindings().Get(ctx, name, 
metav1.GetOptions{})
        if k8serrors.IsNotFound(err) {
                existing = nil
-               obj, err := kubernetes.LoadResourceFromYaml(c.GetScheme(), 
resources.ResourceAsString(path))
+               yaml := resources.ResourceAsString(path)
+               if yaml == "" {
+                       return errors.Errorf("resource file %v not found", path)
+               }
+               obj, err := kubernetes.LoadResourceFromYaml(c.GetScheme(), yaml)
                if err != nil {
                        return err
                }

Reply via email to