mirror of
https://github.com/cozystack/cozystack.git
synced 2026-10-28 15:47:33 +09:00
15 lines
710 B
Bash
Executable File
15 lines
710 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Fake etcd-migrate for hack/migration-50-etcd-adopt.bats: records its full
|
|
# argument vector to $FAKE_CMDLOG and succeeds. The real tool refuses --apply
|
|
# without a backup destination or --skip-backup; the test asserts that the
|
|
# script always passes a destination, so this stub never needs to reproduce
|
|
# that guard.
|
|
set -u
|
|
[ -n "${FAKE_CMDLOG:-}" ] && printf 'ETCD-MIGRATE %s\n' "$*" >> "$FAKE_CMDLOG"
|
|
# FAKE_MIGRATE_FAIL=1 makes the --apply invocation fail, to exercise the
|
|
# migration's restore-operator-on-failure trap (review blocker B1).
|
|
case " $* " in
|
|
*" --apply "*) [ "${FAKE_MIGRATE_FAIL:-0}" = "1" ] && { echo "fake etcd-migrate: forced failure" >&2; exit 1; } ;;
|
|
esac
|
|
exit 0
|