mail-address-semantics/deploy/railiance/apply.sh
tegwick f18eb0b8df Add an on/off switch for the MAS facility.
MAS-WP-0007 is finished. power.sh scales the MX and statute together
and records the power annotation. apply.sh keeps an off facility off.
The live facility was annotated power=on and was not restarted.

Assistant: grok
Assistant-Session: 01a198fa-fd27-7e41-a0a2-57355c3e4efd
2026-11-01 22:46:46 +01:00

23 lines
607 B
Bash
Executable file

#!/bin/sh
# Apply the facility manifest without undoing an off switch (MAS-WP-0007).
# A missing power annotation is on. Refuses to apply when the namespace
# annotation cannot be read.
set -eu
cd "$(dirname "$0")"
if [ "$#" -ne 1 ]; then
echo "usage: apply.sh IMAGE" >&2
exit 2
fi
image=$1
if ! power=$(kubectl get namespace mas \
-o jsonpath='{.metadata.annotations.mas\.coulomb\.social/power}'); then
echo "cannot read namespace mas; refusing to apply" >&2
exit 1
fi
if [ -z "$power" ]; then
power=on
fi
python3 ./facility.py render "$image" "$power" < manifests.yaml | kubectl apply -f -