Skip to content

Ensure init is idempotent and doesn't overwrite repo list. #524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions infra/images/init_collect_signals/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ echo "bucket url = $BUCKET_URL"
echo "bucket prefix file = $BUCKET_PREFIX_FILE"
echo "url data file = $OUTPUT_FILE"

# Exit early if $OUTPUT_FILE already exists. This ensures $OUTPUT_FILE remains
# stable across any restart. Since the file is created atomically we can be
# confident that the file won't be corrupt or truncated.
if [ -f "$OUTPUT_FILE" ]; then
echo "Exiting early. $OUTPUT_FILE already exists."
exit 0
fi

LATEST_PREFIX=`gsutil cat "$BUCKET_URL"/"$BUCKET_PREFIX_FILE"`
echo "latest prefix = $LATEST_PREFIX"

Expand Down