Skip to content
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
5 changes: 3 additions & 2 deletions startupscript/butane/devcontainer-failure-handler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ echo "failed: $(date)" >> "${RETRY_FILE}"
# Check if number of retries have exceeded maximum
num_retries="$(wc -l < "${RETRY_FILE}")"
if [[ "${num_retries}" -ge "${RETRY_COUNT}" ]]; then
# Stop the service
systemctl stop devcontainer.service

# Log failure
source /home/core/metadata-utils.sh
set_metadata "startup_script/status" "ERROR"
error_message=$(get_guest_attribute "startup_script/message" "")
if [[ -z "${error_message}" ]]; then
set_metadata "startup_script/message" "There was an error launching your custom container on the VM. Please try recreating the VM."
fi
# Stop the service
systemctl stop devcontainer.service

if [[ "$SHUTDOWN_ON_FAILURE" == "true" ]]; then
# Sleep for a bit in case logs need to be captured
Expand Down
Loading