mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-23 18:21:27 +00:00
metrics: Improve latency network cleanup
This PR improves the latency network cleanup by removing the pods even if the test fails. Fixes #8658 Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
parent
a998e89bcf
commit
8151117f73
@ -18,6 +18,12 @@ function remove_tmp_file() {
|
|||||||
|
|
||||||
trap remove_tmp_file EXIT
|
trap remove_tmp_file EXIT
|
||||||
|
|
||||||
|
function latency_cleanup() {
|
||||||
|
info "Latency test cleanup"
|
||||||
|
kubectl delete -f "${SCRIPT_PATH}/latency-server.yaml"
|
||||||
|
kubectl delete -f "${SCRIPT_PATH}/latency-client.yaml"
|
||||||
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
init_env
|
init_env
|
||||||
cmds=("bc" "jq")
|
cmds=("bc" "jq")
|
||||||
@ -44,6 +50,8 @@ function main() {
|
|||||||
# Create client
|
# Create client
|
||||||
kubectl create -f "${SCRIPT_PATH}/latency-client.yaml"
|
kubectl create -f "${SCRIPT_PATH}/latency-client.yaml"
|
||||||
|
|
||||||
|
trap latency_cleanup EXIT
|
||||||
|
|
||||||
# Get the names of the client pod
|
# Get the names of the client pod
|
||||||
export client_pod_name="latency-client"
|
export client_pod_name="latency-client"
|
||||||
|
|
||||||
@ -80,9 +88,5 @@ EOF
|
|||||||
metrics_json_add_array_element "$json"
|
metrics_json_add_array_element "$json"
|
||||||
metrics_json_end_array "Results"
|
metrics_json_end_array "Results"
|
||||||
metrics_json_save
|
metrics_json_save
|
||||||
|
|
||||||
kubectl delete pod "$client_pod_name" "$server_pod_name"
|
|
||||||
kubectl get pods -A
|
|
||||||
check_processes
|
|
||||||
}
|
}
|
||||||
main "$@"
|
main "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user