Skip to content

Commit

Permalink
[ci] Fix flexible-ipam e2e config
Browse files Browse the repository at this point in the history
Use k8s version 1.28.9-2.1.
Supress clean up error when initialize e2e.
Enhance redeploy k8s determination logic.

Signed-off-by: gran <[email protected]>
  • Loading branch information
gran-vmv committed May 13, 2024
1 parent 4ec2bdd commit 46d35f8
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions ci/jenkins/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ====="
Expand Down

0 comments on commit 46d35f8

Please sign in to comment.