Covers two scenarios on a single Kind cluster: - Single-repo: deploy create copies commands.py into hooks/, deployment start runs it, mutating the stack-source working tree to v2 + deployment restart re-copies and re-executes v2. - Multi-repo: stack with two pod repos produces hooks/commands_0.py + commands_1.py, deployment start invokes both pod start() hooks. The test stages stack files into a temp git clone (bare + working) so restart's git pull has a real upstream. busybox pods keep the harness trivial. Phase 2 uses kubectl wait directly because deployment ps's substring filter (deploy_k8s.py:1366) doesn't list multi-pod stacks. Also tightens the _copy_hooks docstring to spell out that only call_stack_deploy_start loads from the copied location. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| README.md | ||
| stack.yml | ||
README.md
test-restart-hook-multi
E2E test stack used by tests/k8s-deploy/run-restart-hook-test.sh to cover the
multi-repo case: pods: references two pod repos, each shipping its own
deploy/commands.py. deploy create should produce
<deployment>/hooks/commands_0.py and <deployment>/hooks/commands_1.py, and
deployment start should invoke both start() hooks (each writes its own
marker file so neither overwrites the other).
The pod repos themselves are created by the test script as bare-repo +
working-clone pairs under $CERC_REPO_BASE_DIR/test-restart-hook-pod-{a,b};
they are not committed to this repository. Each pod repo ships its own
docker-compose.yml (resolved by get_pod_file_path for dict-form pods) and
stack/deploy/commands.py — the stack repo only owns stack.yml.