diff --git a/test/Makefile b/test/Makefile index 91af73b3f6..e97e696bba 100644 --- a/test/Makefile +++ b/test/Makefile @@ -226,7 +226,8 @@ setup_kurise: docker pull $${IMAGE} ; \ kind load docker-image $${IMAGE} --name $(E2E_CLUSTER_NAME); \ done; \ - helm install kruise openkruise/kruise --kubeconfig $(E2E_KUBECONFIG) --wait --debug --set manager.image.repository=$(E2E_OPENKRUISE_IMAGE) + helm upgrade --install kruise openkruise/kruise --wait --debug \ + --kubeconfig $(E2E_KUBECONFIG) || { KIND_CLUSTER_NAME=$(E2E_CLUSTER_NAME) ./scripts/debugEnv.sh $(E2E_KUBECONFIG) "detail" ; exit 1 ; } ; \ .PHONY: setup_spiderpool setup_spiderpool: diff --git a/test/scripts/debugEnv.sh b/test/scripts/debugEnv.sh index cee08cdceb..caeced357c 100755 --- a/test/scripts/debugEnv.sh +++ b/test/scripts/debugEnv.sh @@ -25,7 +25,7 @@ CONTROLLER_POD_LIST=$( kubectl get pods --no-headers --kubeconfig ${E2E_KUBECONF AGENT_POD_LIST=$( kubectl get pods --no-headers --kubeconfig ${E2E_KUBECONFIG} --namespace ${NAMESPACE} --selector app.kubernetes.io/component=spiderpool-agent --output jsonpath={.items[*].metadata.name} ) KUBEVIRT_HANDLER_POD_LIST=$( kubectl get pods --no-headers --kubeconfig ${E2E_KUBECONFIG} --namespace kubevirt --selector kubevirt.io=virt-handler --output jsonpath={.items[*].metadata.name} ) KDOCTOR_POD_LIST=$( kubectl get pods --no-headers --kubeconfig ${E2E_KUBECONFIG} --namespace ${NAMESPACE} --selector app.kubernetes.io/instance=kdoctor --output jsonpath={.items[*].metadata.name} ) - +KRUISE_POD_LIST=$( kubectl get pods --no-headers --kubeconfig ${E2E_KUBECONFIG} --namespace kruise-system --output jsonpath={.items[*].metadata.name} ) [ -z "$CONTROLLER_POD_LIST" ] && echo "error, failed to find any spider controller pod" && exit 1 [ -z "$AGENT_POD_LIST" ] && echo "error, failed to find any spider agent pod" && exit 1 @@ -268,6 +268,17 @@ elif [ "$TYPE"x == "detail"x ] ; then kubectl logs ${POD} -n ${NAMESPACE} --kubeconfig ${E2E_KUBECONFIG} --previous done + + echo "" + echo "=============== open kruise logs ============== " + for POD in $KRUISE_POD_LIST ; do + echo "" + echo "--------- kubectl logs ${POD} -n kruise-system " + kubectl logs ${POD} -n kruise-system --kubeconfig ${E2E_KUBECONFIG} + echo "--------- kubectl logs ${POD} -n kruise-system --previous" + kubectl logs ${POD} -n kruise-system --kubeconfig ${E2E_KUBECONFIG} --previous + done + elif [ "$TYPE"x == "error"x ] ; then CHECK_ERROR(){ LLOG_MARK="$1"