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
23 lines
607 B
Bash
Executable file
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 -
|