diff --git a/ci/jenkins/test.sh b/ci/jenkins/test.sh index 67dea80733d..a4c14473352 100755 --- a/ci/jenkins/test.sh +++ b/ci/jenkins/test.sh @@ -35,7 +35,7 @@ IMAGE_PULL_POLICY="Always" PROXY_ALL=false DEFAULT_IP_MODE="ipv4" IP_MODE="" -K8S_VERSION="1.28.2-00" +K8S_VERSION="1.28.9-2.1" WINDOWS_YAML_SUFFIX="windows" WIN_IMAGE_NODE="" echo "" > WIN_DHCP @@ -169,15 +169,15 @@ function export_govc_env_var { function clean_antrea { echo "====== Cleanup Antrea Installation ======" - clean_ns "monitoring" - clean_ns "antrea-ipam-test" - clean_ns "antrea-test" + clean_ns "monitoring" || true + clean_ns "antrea-ipam-test" || true + clean_ns "antrea-test" || true echo "====== Cleanup Conformance Namespaces ======" - clean_ns "net" - clean_ns "service" - clean_ns "x-" - clean_ns "y-" - clean_ns "z-" + clean_ns "net" || true + clean_ns "service" || true + clean_ns "x-" || true + clean_ns "y-" || true + clean_ns "z-" || true # Delete antrea-prometheus first for k8s>=1.22 to avoid Pod stuck in Terminating state. kubectl delete -f ${WORKDIR}/antrea-prometheus.yml --ignore-not-found=true || true @@ -853,24 +853,26 @@ function redeploy_k8s_if_ip_mode_changes() { HAS_IPV6=${INITIAL_VALUE} POD_CIDRS=($( (kubectl get node ${CONTROL_PLANE_HOSTNAME} -o json | jq -r '.spec.podCIDRs | @sh') | tr -d \'\")) || true echo "POD_CIDRS=${POD_CIDRS[*]}" - for POD_CIDR in "${POD_CIDRS[@]}"; do - if [[ $POD_CIDR =~ .*:.* ]] - then - (( HAS_IPV6++ )) + if [[ -n $POD_CIDRS ]]; then + for POD_CIDR in "${POD_CIDRS[@]}"; do + if [[ $POD_CIDR =~ .*:.* ]] + then + (( HAS_IPV6++ )) + else + (( HAS_IPV4++ )) + fi + done + if [[ ${IP_MODE} == "ipv4" ]]; then + (( HAS_IPV4-- )) + elif [[ ${IP_MODE} == "ipv6" ]]; then + (( HAS_IPV6-- )) else - (( HAS_IPV4++ )) + (( HAS_IPV4-- )) + (( HAS_IPV6-- )) + fi + if [ ${HAS_IPV4} -eq ${INITIAL_VALUE} ] && [ ${HAS_IPV6} -eq ${INITIAL_VALUE} ]; then + return 0 fi - done - if [[ ${IP_MODE} == "ipv4" ]]; then - (( HAS_IPV4-- )) - elif [[ ${IP_MODE} == "ipv6" ]]; then - (( HAS_IPV6-- )) - else - (( HAS_IPV4-- )) - (( HAS_IPV6-- )) - fi - if [ ${HAS_IPV4} -eq ${INITIAL_VALUE} ] && [ ${HAS_IPV6} -eq ${INITIAL_VALUE} ]; then - return 0 fi echo "===== Reset K8s cluster Nodes ====="