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
pull/6/head
k8s-merge-robot 2016-03-31 06:32:54 -07:00
commit 5e159695d9
1 changed files with 3 additions and 1 deletions

View File

@ -328,7 +328,9 @@ fi
# * started and destroyed (normal e2e)
# * neither started nor destroyed (soak test)
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!"
exit 1
fi