diff --git a/Makefile b/Makefile index 2d80b2e872..c751d0f246 100644 --- a/Makefile +++ b/Makefile @@ -324,17 +324,18 @@ e2e_init_spiderpool: .PHONY: e2e_init_cilium_ebpfservice e2e_init_cilium_ebpfservice: - $(QUIET) make e2e_init -e INSTALL_OVERLAY_CNI=true -e INSTALL_CALICO=false -e INSTALL_CILIUM=true -e DISABLE_KUBE_PROXY=true -e E2E_SPIDERPOOL_ENABLE_SUBNET=false + $(QUIET) make e2e_init -e INSTALL_OVERLAY_CNI=true -e INSTALL_CALICO=false -e INSTALL_CILIUM=true -e DISABLE_KUBE_PROXY=true \ + -e E2E_SPIDERPOOL_ENABLE_SUBNET=false -e INSTALL_OVS=false .PHONY: e2e_init_calico e2e_init_calico: $(QUIET) make e2e_init -e INSTALL_OVERLAY_CNI=true -e INSTALL_CALICO=true -e INSTALL_CILIUM=false -e E2E_SPIDERPOOL_ENABLE_SUBNET=false \ - E2E_SPIDERPOOL_ENABLE_DRA=true + -e E2E_SPIDERPOOL_ENABLE_DRA=true -e INSTALL_OVS=false .PHONY: e2e_init_cilium_legacyservice e2e_init_cilium_legacyservice: - $(QUIET) make e2e_init -e INSTALL_OVERLAY_CNI=true -e INSTALL_CALICO=false -e INSTALL_CILIUM=true -e DISABLE_KUBE_PROXY=false -e E2E_SPIDERPOOL_ENABLE_SUBNET=false - + $(QUIET) make e2e_init -e INSTALL_OVERLAY_CNI=true -e INSTALL_CALICO=false -e INSTALL_CILIUM=true -e DISABLE_KUBE_PROXY=false \ + -e E2E_SPIDERPOOL_ENABLE_SUBNET=false -e INSTALL_OVS=false .PHONY: e2e_test e2e_test: diff --git a/test/Makefile b/test/Makefile index 5263570b45..4cff895cfa 100644 --- a/test/Makefile +++ b/test/Makefile @@ -225,7 +225,11 @@ setup_kruise: docker pull $${IMAGE} ; \ kind load docker-image $${IMAGE} --name $(E2E_CLUSTER_NAME); \ done; \ - helm upgrade --install kruise openkruise/kruise --wait --timeout 20m --debug --set manager.image.repository=$(E2E_OPENKRUISE_IMAGE) \ + HELM_OPTION=" --wait --timeout 20m --debug --set manager.image.repository=$(E2E_OPENKRUISE_IMAGE) " ; \ + # openkruise failed to run with 1.7.3, see + # https://github.com/spidernet-io/spiderpool/issues/4396 + HELM_OPTION+=" --version $(E2E_OPENKRUISE_VERSION) " ; \ + helm upgrade --install kruise openkruise/kruise $${HELM_OPTION} \ --kubeconfig $(E2E_KUBECONFIG) || { KIND_CLUSTER_NAME=$(E2E_CLUSTER_NAME) ./scripts/debugEnv.sh $(E2E_KUBECONFIG) "detail" "$(E2E_LOG_FILE)" ; exit 1 ; } ; \ .PHONY: setup_spiderpool diff --git a/test/Makefile.defs b/test/Makefile.defs index c1e1761007..edb436cf86 100644 --- a/test/Makefile.defs +++ b/test/Makefile.defs @@ -190,7 +190,9 @@ E2E_LOG_FILE ?= $(ROOT_DIR)/test/e2edebugLog.txt E2E_UNINSTALL_LOG_FILE ?= $(ROOT_DIR)/test/e2e-uninstall-debugLog.txt #========= openkruise ========= - +# openkruise failed to run with 1.7.3, see +# https://github.com/spidernet-io/spiderpool/issues/4396 +E2E_OPENKRUISE_VERSION := 1.7.2 ifeq ($(E2E_CHINA_IMAGE_REGISTRY),true) E2E_OPENKRUISE_IMAGE ?= docker.m.daocloud.io/openkruise/kruise-manager else diff --git a/test/scripts/install-ovs.sh b/test/scripts/install-ovs.sh index 229684664d..03c95289f6 100644 --- a/test/scripts/install-ovs.sh +++ b/test/scripts/install-ovs.sh @@ -5,7 +5,7 @@ set -o errexit -o nounset -o pipefail -CURRENT_FILENAME=$( basename $0 ) +CURRENT_FILENAME=$(basename $0) [ -z "${HTTP_PROXY}" ] || export https_proxy=${HTTP_PROXY} @@ -25,7 +25,10 @@ echo "$CURRENT_FILENAME : HOST_ADDITIONAL_INTERFACE $HOST_ADDITIONAL_INTERFACE " echo "try to add secondary network nic for ovs bridge preparation" if ! docker network ls | grep -q "${DOCKER_ADDITIONAL_NETWORK}"; then echo "Docker network ${DOCKER_ADDITIONAL_NETWORK} does not exist, creating it..." - docker network create ${DOCKER_ADDITIONAL_NETWORK} --driver bridge || { echo "Failed to create Docker network"; exit 1; } + docker network create ${DOCKER_ADDITIONAL_NETWORK} --driver bridge || { + echo "Failed to create Docker network" + exit 1 + } else echo "Docker network ${DOCKER_ADDITIONAL_NETWORK} already exists." fi @@ -53,17 +56,16 @@ elif [ ${E2E_IP_FAMILY} == "dual" ]; then docker exec ${VLAN_GATEWAY_CONTAINER} ip addr add fd00:172:30::1/64 dev ${HOST_ADDITIONAL_INTERFACE}.${VLAN30} docker exec ${VLAN_GATEWAY_CONTAINER} ip addr add fd00:172:40::1/64 dev ${HOST_ADDITIONAL_INTERFACE}.${VLAN40} else - echo "error ip family, the value of IP_FAMILY must be of ipv4,ipv6 or dual." && exit 1 + echo "error ip family, the value of IP_FAMILY must be of ipv4,ipv6 or dual." && exit 1 fi echo -e "\033[35m Succeed to create vlan interface: ${HOST_ADDITIONAL_INTERFACE}.${VLAN30}、 ${HOST_ADDITIONAL_INTERFACE}.${VLAN40} in kind-node ${VLAN_GATEWAY_CONTAINER} \033[0m" - # https://github.com/antrea-io/antrea/issues/51 # fix: it possibley fails to insmod openvswitch.ko in the container in some OS version # so it could load the ko in the host os in advance to make sure the ovs service could be started in the container echo "=========install openvswitch in host os" -sudo apt-get update +sudo apt-get update sudo apt-get install -y openvswitch-switch sudo modinfo openvswitch sudo systemctl start openvswitch-switch || true @@ -78,18 +80,18 @@ for NODE in $KIND_NODES; do install_openvswitch() { for attempt in {1..5}; do echo "Attempt $attempt to install openvswitch on ${NODE}..." - if ! docker exec ${NODE} apt-get update ; then + if ! docker exec ${NODE} apt-get update; then echo "Failed to update package list on ${NODE}, retrying in 10s..." sleep 10 continue fi - - if ! docker exec ${NODE} apt-get install -y openvswitch-switch ; then + + if ! docker exec ${NODE} apt-get install -y openvswitch-switch; then echo "Failed to install openvswitch on ${NODE}, retrying in 10s..." sleep 10 continue fi - + echo "Succeed to install openvswitch on ${NODE}" return 0 done @@ -97,13 +99,18 @@ for NODE in $KIND_NODES; do echo "Error: Failed to install openvswitch on ${NODE} after 5 attempts." >&2 return 1 } - + echo "=========install openvswitch" install_openvswitch echo "start ovs service and add bridge" - { docker exec ${NODE} systemctl start openvswitch-switch ; } \ - || { docker exec ${NODE} journalctl -xe ; docker exec ${NODE} systemctl status openvswitch-switch ; docker exec ${NODE} journalctl -u openvswitch-switch ; exit 1 ; } + { docker exec ${NODE} systemctl start openvswitch-switch; } || + { + docker exec ${NODE} journalctl -xe + docker exec ${NODE} systemctl status openvswitch-switch + docker exec ${NODE} journalctl -u openvswitch-switch + exit 1 + } docker exec ${NODE} ovs-vsctl add-br ${BRIDGE_INTERFACE} docker exec ${NODE} ovs-vsctl add-port ${BRIDGE_INTERFACE} ${HOST_ADDITIONAL_INTERFACE} @@ -139,4 +146,3 @@ for NODE in $KIND_NODES; do done echo -e "\033[35m Succeed to install openvswitch \033[0m" -