Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fix: CSE file wait is idempotent (#2192)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis committed Oct 22, 2019
1 parent 5bfc45f commit 15dd58c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions parts/k8s/cloud-init/artifacts/cse_helpers.sh
Expand Up @@ -137,6 +137,8 @@ retrycmd_get_executable() {
}
wait_for_file() {
retries=$1; wait_sleep=$2; filepath=$3
paved=/opt/azure/cloud-init-files.paved
grep -Fq "${filepath}" $paved && return 0
for i in $(seq 1 $retries); do
grep -Fq '#EOF' $filepath && break
if [ $i -eq $retries ]; then
Expand All @@ -146,6 +148,7 @@ wait_for_file() {
fi
done
sed -i "/#EOF/d" $filepath
echo $filepath >> $paved
}
wait_for_apt_locks() {
while fuser /var/lib/dpkg/lock /var/lib/apt/lists/lock /var/cache/apt/archives/lock >/dev/null 2>&1; do
Expand Down
3 changes: 3 additions & 0 deletions pkg/engine/templates_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 15dd58c

Please sign in to comment.