Skip to content

Commit 7f17137

Browse files
committed
e2e: only run DescribeCluster if v1beta2 Cluster CRD is there
1 parent a8e4187 commit 7f17137

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/framework/cluster_helpers.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,19 @@ func DescribeAllCluster(ctx context.Context, input DescribeAllClusterInput) {
403403
Expect(input.LogFolder).ToNot(BeEmpty(), "Invalid argument. input.LogFolder can't be empty when calling DescribeAllCluster")
404404
Expect(input.Namespace).ToNot(BeNil(), "Invalid argument. input.Namespace can't be nil when calling DescribeAllCluster")
405405

406+
types := getClusterAPITypes(ctx, input.Lister)
407+
clusterAPIVersion := ""
408+
for t := range types {
409+
if t.Kind == "Cluster" {
410+
clusterAPIVersion = t.APIVersion
411+
break
412+
}
413+
}
414+
if clusterAPIVersion != clusterv1.GroupVersion.String() {
415+
log.Logf("Skipping DescribeCluster because detected Cluster CR in APIVersion %q but require %q", clusterAPIVersion, clusterv1.GroupVersion.String())
416+
return
417+
}
418+
406419
clusters := &clusterv1.ClusterList{}
407420
Eventually(func() error {
408421
return input.Lister.List(ctx, clusters, client.InNamespace(input.Namespace))

0 commit comments

Comments
 (0)