Last active
August 9, 2019 13:59
-
-
Save lwille/011509c9bde028b6948dfee3e490c10e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Prerequisites: | |
# - `/bin/bash` and `shasum` available in pod | |
function wait_k8sync() { | |
local pod=$1 | |
local file_local=$2 | |
local file_remote=$3 | |
echo -n Waiting for remote file ${file_remote} to reflect changes from ${file_local}... | |
while ! diff <(shasum ${file_local} | cut -b 1-8 ) <(kubectl exec ${pod} /bin/bash -- -c "shasum ${file_remote} | cut -b 1-8") > /dev/null; do | |
echo -n . | |
sleep 1 | |
done | |
echo file is up to date | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment