Skip to content

Commit e4a03db

Browse files
aleolicheina97
authored andcommitted
test(e2e): use cluster count, add image patch
1 parent 46d0b2c commit e4a03db

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

test/e2e/cruise/apiserverinteraction/apiserver_interaction_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ var _ = Describe("Liqo E2E", func() {
9999

100100
By("Ensuring virtual nodes are ready")
101101
Eventually(func() bool {
102-
return util.CheckVirtualNodes(ctx, testContext.Clusters[0].NativeClient, clustersRequired)
102+
return util.CheckVirtualNodes(ctx, testContext.Clusters[0].NativeClient, testContext.ClustersNumber)
103103
}, timeout, interval).Should(BeTrue())
104104

105105
Expect(util.OffloadNamespace(testContext.Clusters[0].KubeconfigPath, namespaceName,

test/e2e/testutils/apiserver/create.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"context"
2020
"fmt"
2121
"os"
22+
"strings"
2223

2324
batchv1 "k8s.io/api/batch/v1"
2425
corev1 "k8s.io/api/core/v1"
@@ -61,7 +62,7 @@ func CreateKubectlJob(ctx context.Context, cl client.Client, namespace string, v
6162
Spec: corev1.PodSpec{
6263
Containers: []corev1.Container{{
6364
Name: containerName,
64-
Image: fmt.Sprintf("%s:%s.%s", image, v.Major, v.Minor),
65+
Image: fmt.Sprintf("%s:%s.%s.%s", image, v.Major, v.Minor, patchVersion(v)),
6566
Args: []string{"get", "pods", "-n", namespace, "--no-headers", "-o", "custom-columns=:.metadata.name"},
6667
Resources: util.ResourceRequirements(),
6768
}},
@@ -113,3 +114,12 @@ func CreateRoleBinding(ctx context.Context, cl client.Client, namespace string)
113114
}
114115
return cl.Create(ctx, rb)
115116
}
117+
118+
func patchVersion(v *version.Info) string {
119+
tmp := strings.Split(v.GitVersion, ".")
120+
if len(tmp) < 3 {
121+
return ""
122+
}
123+
patch := tmp[2]
124+
return strings.Split(patch, "+")[0]
125+
}

0 commit comments

Comments
 (0)