Skip to content

Commit 9e07b46

Browse files
committed
updating logic of fetching version
1 parent 8f2b32c commit 9e07b46

File tree

2 files changed

+25
-26
lines changed

2 files changed

+25
-26
lines changed

scripts/run-mixed-os-snat-kube-proxy-test.sh

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ INTEGRATION_TEST_DIR="$SCRIPT_DIR/../test/integration"
99

1010
# Defaults
1111
: "${AWS_DEFAULT_REGION:=us-west-2}"
12-
: "${CLUSTER_NAME:=cni-mixed-os-$RANDOM}"
12+
: "${CLUSTER_NAME:=cni-mixed-os-$(date +%s)}"
1313
: "${K8S_VERSION:=1.31}"
1414
: "${IP_FAMILY:=IPv4}"
1515
: "${NODES_PER_OS:=2}"
@@ -210,24 +210,24 @@ update_cni_image
210210
VPC_ID=$(get_vpc_id)
211211
echo "Using VPC: $VPC_ID"
212212

213-
# # Run tests on each OS type
214-
# for os in "${OS_TYPES[@]}"; do
215-
# run_tests_for_os "$os" || true
216-
# done
217-
218-
# # Summary
219-
# echo ""
220-
# echo "========================================"
221-
# echo "Test Summary"
222-
# echo "========================================"
223-
# if [[ ${#FAILED_OS[@]} -eq 0 ]]; then
224-
# echo "All OS types PASSED"
225-
# else
226-
# echo "FAILED OS types: ${FAILED_OS[*]}"
227-
# fi
228-
229-
# if [[ "$DEPROVISION" == true ]]; then
230-
# delete_cluster
231-
# fi
232-
233-
# [[ ${#FAILED_OS[@]} -eq 0 ]]
213+
# Run tests on each OS type
214+
for os in "${OS_TYPES[@]}"; do
215+
run_tests_for_os "$os" || true
216+
done
217+
218+
# Summary
219+
echo ""
220+
echo "========================================"
221+
echo "Test Summary"
222+
echo "========================================"
223+
if [[ ${#FAILED_OS[@]} -eq 0 ]]; then
224+
echo "All OS types PASSED"
225+
else
226+
echo "FAILED OS types: ${FAILED_OS[*]}"
227+
fi
228+
229+
if [[ "$DEPROVISION" == true ]]; then
230+
delete_cluster
231+
fi
232+
233+
[[ ${#FAILED_OS[@]} -eq 0 ]]

test/integration/cni/snat_kube_proxy_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ package cni
1111
import (
1212
"context"
1313
"fmt"
14-
"strconv"
1514
"strings"
1615
"time"
1716

17+
"github.com/Masterminds/semver/v3"
1818
"github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest"
1919
"github.com/aws/amazon-vpc-cni-k8s/test/framework/utils"
2020
"github.com/aws/amazon-vpc-cni-k8s/test/integration/common"
@@ -90,10 +90,9 @@ var _ = Describe("test SNAT with kube-proxy modes", func() {
9090

9191
ver, err := f.DiscoveryClient.ServerVersion()
9292
Expect(err).ToNot(HaveOccurred())
93-
minor, err := strconv.Atoi(ver.Minor)
93+
semVer, err := semver.NewVersion(ver.String())
9494
Expect(err).ToNot(HaveOccurred())
95-
96-
if minor <= 32 && mode == "nftables" {
95+
if semVer.Minor() <= 32 && mode == "nftables" {
9796
return
9897
}
9998

0 commit comments

Comments
 (0)