Commit 5e159695 authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #23422 from gmarek/diff

Automatic merge from submit-queue When checking for leak look only at additional resources This should help with "fake" leaks, when run deletes stuff that was leaked in a previous one. cc @zmerlynn @ixdy @wojtek-t
parents 62eb7d3d 5555cbeb
...@@ -328,7 +328,9 @@ fi ...@@ -328,7 +328,9 @@ fi
# * started and destroyed (normal e2e) # * started and destroyed (normal e2e)
# * neither started nor destroyed (soak test) # * neither started nor destroyed (soak test)
if [[ "${E2E_UP:-}" == "${E2E_DOWN:-}" && -f "${gcp_resources_before}" && -f "${gcp_resources_after}" ]]; then if [[ "${E2E_UP:-}" == "${E2E_DOWN:-}" && -f "${gcp_resources_before}" && -f "${gcp_resources_after}" ]]; then
if ! diff -sw -U0 -F'^\[.*\]$' "${gcp_resources_before}" "${gcp_resources_after}" && [[ "${FAIL_ON_GCP_RESOURCE_LEAK:-}" == "true" ]]; then difference=$(diff -sw -U0 -F'^\[.*\]$' "${gcp_resources_before}" "${gcp_resources_after}") || true
if [[ -n $(echo "${difference}" | tail -n +3 | grep -E "^\+") ]] && [[ "${FAIL_ON_GCP_RESOURCE_LEAK:-}" == "true" ]]; then
echo "${difference}"
echo "!!! FAIL: Google Cloud Platform resources leaked while running tests!" echo "!!! FAIL: Google Cloud Platform resources leaked while running tests!"
exit 1 exit 1
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment