Skip to content

Commit

Permalink
Added debug log for open-kruise installation failure
Browse files Browse the repository at this point in the history
Signed-off-by: tao.yang <tao.yang@daocloud.io>
  • Loading branch information
ty-dc committed Aug 22, 2024
1 parent 802f450 commit 64f6a0d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 12 additions & 1 deletion test/scripts/debugEnv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 64f6a0d

Please sign in to comment.