You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2020/09/17 09:10:15 UTC

[camel-k] 20/21: Fix #1574: fix waiting for CRD installation

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

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

commit 4316b0378dca4fb8d1c585c0dd47bc17739fffc6
Author: nicolaferraro <ni...@gmail.com>
AuthorDate: Wed Sep 16 12:39:09 2020 +0200

    Fix #1574: fix waiting for CRD installation
---
 pkg/install/cluster.go | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/pkg/install/cluster.go b/pkg/install/cluster.go
index 8fdc902..7758b70 100644
--- a/pkg/install/cluster.go
+++ b/pkg/install/cluster.go
@@ -80,6 +80,11 @@ func SetupClusterWideResourcesOrCollect(ctx context.Context, clientProvider clie
 		return err
 	}
 
+	// Wait for all CRDs to be installed before proceeding
+	if err := WaitForAllCRDInstallation(ctx, clientProvider, 25*time.Second); err != nil {
+		return err
+	}
+
 	// Installing ClusterRole
 	clusterRoleInstalled, err := IsClusterRoleInstalled(ctx, c)
 	if err != nil {
@@ -98,11 +103,6 @@ func SetupClusterWideResourcesOrCollect(ctx context.Context, clientProvider clie
 		return err
 	}
 
-	// Wait for all CRDs to be installed before proceeding
-	if err := WaitForAllCRDInstallation(ctx, clientProvider, 25*time.Second); err != nil {
-		return err
-	}
-
 	return nil
 }
 
@@ -156,7 +156,12 @@ func AreAllCRDInstalled(ctx context.Context, c client.Client) (bool, error) {
 	} else if !ok {
 		return false, nil
 	}
-	return IsCRDInstalled(ctx, c, "Kamelet", "v1alpha1")
+	if ok, err := IsCRDInstalled(ctx, c, "Kamelet", "v1alpha1"); err != nil {
+		return ok, err
+	} else if !ok {
+		return false, nil
+	}
+	return IsCRDInstalled(ctx, c, "KameletBinding", "v1alpha1")
 }
 
 // IsCRDInstalled check if the given CRD kind is installed