Skip to content

Commit a972d2d

Browse files
committed
CCM E2E - K8s version check fix
1 parent 4c819a9 commit a972d2d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

test/e2e/cloud-provider-oci/load_balancer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,8 @@ var _ = Describe("IpMode [Slow]", func() {
699699
}
700700
Context("[cloudprovider][ccm][lb][ipMode]", func() {
701701
It("traffic should work from pods via load balancer", func() {
702-
if sharedfw.CompareVersions(setupF.OkeClusterK8sVersion, "v1.30") < 0 {
703-
Skip("Cluster K8s Version " + setupF.OkeClusterK8sVersion + " is less than v1.30, skipping test for Load Balancer ingress ipMode=\"Proxy\"")
702+
if sharedfw.CompareVersions(f.OkeClusterK8sVersion, "v1.30") < 0 {
703+
Skip("Cluster K8s Version " + f.OkeClusterK8sVersion + " is less than v1.30, skipping test for Load Balancer ingress ipMode=\"Proxy\"")
704704
}
705705
for _, test := range esippTestsArray {
706706
By("Running test for: " + test.lbType)
@@ -790,8 +790,8 @@ var _ = Describe("ESIPP - IpMode Proxy [Slow]", func() {
790790
}
791791
Context("[cloudprovider][ccm][lb][esipp]", func() {
792792
It("should preserve source IP of pod with ipMode Proxy", func() {
793-
if sharedfw.CompareVersions(setupF.OkeClusterK8sVersion, "v1.30") < 0 {
794-
Skip("Cluster K8s Version " + setupF.OkeClusterK8sVersion + " is less than v1.30, skipping test for ESIPP since it relies on ipMode=\"Proxy\"")
793+
if sharedfw.CompareVersions(f.OkeClusterK8sVersion, "v1.30") < 0 {
794+
Skip("Cluster K8s Version " + f.OkeClusterK8sVersion + " is less than v1.30, skipping test for ESIPP since it relies on ipMode=\"Proxy\"")
795795
}
796796
for _, test := range esippTestsArray {
797797
By("Running test for: " + test.lbType)

test/e2e/framework/cloud_provider_framework.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ type CloudProviderFramework struct {
9191
// Backend Nsg ocids test
9292
BackendNsgOcids string
9393
RunUhpE2E bool
94+
95+
OkeClusterK8sVersion string
9496
}
9597

9698
// NewDefaultFramework constructs a new e2e test CloudProviderFramework with default options.
@@ -294,6 +296,9 @@ func (f *CloudProviderFramework) BeforeEach() {
294296
f.BlockStorageClient = f.createStorageClient()
295297
f.ComputeClient = f.createComputeClient()
296298
}
299+
300+
k8sVersion, _ := f.ClientSet.Discovery().ServerVersion()
301+
f.OkeClusterK8sVersion = fmt.Sprintf("v%s", k8sVersion)
297302
}
298303

299304
// AfterEach deletes the namespace(s).

0 commit comments

Comments
 (0)