Skip to content

Commit 1ccc5fc

Browse files
committed
Timeout when writing to pipe
1 parent 4cc6b08 commit 1ccc5fc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

startupscript/butane/055-provide-secrets.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ done
190190
echo "Delivering ${PIPE_SECRET_COUNT} secret(s) to container..."
191191

192192
set +o xtrace
193-
echo "${SECRETS_JSON}" | docker exec -i "${CONTAINER_NAME}" sh -c "cat > ${PIPE_PATH}"
194-
set -o xtrace
193+
if ! echo "${SECRETS_JSON}" | timeout 30 docker exec -i "${CONTAINER_NAME}" sh -c "cat > ${PIPE_PATH}"; then
194+
>&2 echo "ERROR: Timed out writing secrets to container pipe."
195+
exit 1
196+
fi
195197

196198
echo "Secrets delivered successfully."

0 commit comments

Comments
 (0)