Unverified Commit bbc1ceba authored by Natalie Serrino's avatar Natalie Serrino Committed by Copybara
Browse files

Fix non-zero exit code in load_dev_db script

Summary: load_dev_db.sh was failing. It turns out we try to end the kubectl port-forward process twice, once with a TERM signal and once with a KILL signal. In the event that the TERM signal works, the kill command will fail. This diff makes it so that we only escalate to a kill if the TERM didn't work.

Test Plan: ran the script, it now succeeds

Reviewers: vihang, michelle, philkuz

Reviewed By: michelle

Differential Revision: https://phab.corp.pixielabs.ai/D8459

GitOrigin-RevId: 7106408c5d71ca20c801b1e62a2f1351e7852ec0
parent 6ab4ecaa
Showing with 6 additions and 2 deletions
+6 -2
......@@ -90,5 +90,9 @@ fi
# Kill kubectl port-forward.
kill -15 "$!"
sleep 2
# Make sure process cleans up properly.
kill -9 "$!" 2> /dev/null
# Double check that it's dead.
if pidof "$!"; then
kill -9 "$!"
fi
Supports Markdown
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