Skip to content

Commit

Permalink
Fix apache#1574: fix waiting for CRD installation
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaferraro committed Sep 16, 2020
1 parent 96dc01b commit 3d87e3d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions pkg/install/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3d87e3d

Please sign in to comment.