Fall back to default behavior when deployed to a worker node (#593)

* Add test demonstrating failure when running on worker node

* Consider manager status when checking for swarm related features

* Update documentation
This commit is contained in:
Frederik Ring
2025-06-09 14:19:18 +02:00
committed by GitHub
parent 5291c5cc1c
commit 0ce19a4ff2
9 changed files with 131 additions and 7 deletions

33
test/worker-node/run.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
set -e
cd $(dirname $0)
. ../util.sh
current_test=$(basename $(pwd))
export TMP_DIR=$(mktemp -d)
export LOCAL_DIR=$(mktemp -d)
while [ -z $(docker ps -q -f name=backup) ]; do
info "Backup container not ready yet. Retrying."
sleep 1
done
sleep 20
docker exec $(docker ps -q -f name=backup) backup
mkdir -p /archive
docker cp $(docker ps -q -f name=backup):/archive $LOCAL_DIR
tar -xvf "$LOCAL_DIR/archive/test.tar.gz" -C $TMP_DIR
if [ ! -f "$TMP_DIR/backup/data/dump.sql" ]; then
fail "Could not find file written by pre command."
fi
pass "Found expected file."
if [ -f "$TMP_DIR/backup/data/post.txt" ]; then
fail "File created in post command was present in backup."
fi
pass "Did not find unexpected file."