Skip to content

Commit

Permalink
Ignore failure when running 'kubectl cp'
Browse files Browse the repository at this point in the history
Signed-off-by: Lan Luo <luola@vmware.com>
  • Loading branch information
luolanzone committed Apr 28, 2024
1 parent 89363ac commit db37f36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ci/jenkins/test-mc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,9 @@ function collect_coverage {
mc_controller_pod_name="$(kubectl get pods --selector=app=antrea,component=antrea-mc-controller -n ${namespace} --no-headers=true ${kubeconfig} | awk '{ print $1 }')"
controller_pid="$(kubectl exec -i $mc_controller_pod_name -n ${namespace} ${kubeconfig} -- pgrep antrea)"
kubectl exec -i $mc_controller_pod_name -n ${namespace} ${kubeconfig} -- kill -SIGINT $controller_pid
set +e
kubectl cp ${namespace}/$mc_controller_pod_name:antrea-mc-controller.cov.out ${COVERAGE_DIR}/$mc_controller_pod_name-$timestamp ${kubeconfig}
set -e
done
}

Expand Down
4 changes: 4 additions & 0 deletions ci/jenkins/test-vmc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -625,15 +625,19 @@ function collect_coverage() {
controller_pid="$(kubectl exec -i $antrea_controller_pod_name -n kube-system -- pgrep antrea)"
kubectl exec -i $antrea_controller_pod_name -n kube-system -- kill -SIGINT $controller_pid
timestamp=$(date +%Y%m%d%H%M%S)
set +e
kubectl cp kube-system/$antrea_controller_pod_name:antrea-controller.cov.out ${GIT_CHECKOUT_DIR}/conformance-coverage/$antrea_controller_pod_name-$timestamp
set -e

antrea_agent_pod_names="$(kubectl get pods --selector=app=antrea,component=antrea-agent -n kube-system --no-headers=true | awk '{ print $1 }')"
for agent in ${antrea_agent_pod_names}
do
agent_pid="$(kubectl exec -i $agent -n kube-system -- pgrep antrea)"
kubectl exec -i $agent -c antrea-agent -n kube-system -- kill -SIGINT $agent_pid
timestamp=$(date +%Y%m%d%H%M%S)
set +e
kubectl cp kube-system/$agent:antrea-agent.cov.out -c antrea-agent ${GIT_CHECKOUT_DIR}/conformance-coverage/$agent-$timestamp
set -e
done
}

Expand Down

0 comments on commit db37f36

Please sign in to comment.