P1: restore-world.sh claims its objects path (mkdir) and the database (a held session with a restore try-lock and the exclusive upgrade lock), and removes only what it created, so a losing restore never drops a winner's schema. P2: barrier Ready-pod selection via shared jsonpath helper with fixtures; barrier pod fsGroup; script-generated pods inspected by the policy check; World0 PV claim references protected; ci-paths.sh uses the event's real base and runs on uncertainty; fault-drill asserts RTO and needs positive quarantine evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
1.1 KiB
Bash
23 lines
1.1 KiB
Bash
# Shared pod-status helpers for the operations scripts (sourced, not executed).
|
|
#
|
|
# POD_STATUS_JSONPATH renders one line per pod, "<name>|<Ready status>|<deletion>",
|
|
# with plain kubectl jsonpath (no template variables): the Ready status is "True",
|
|
# "False" or empty when the pod has no Ready condition yet, and the deletion field is
|
|
# empty unless the pod is being deleted. single_ready_pod reads such lines on stdin
|
|
# and prints the one Ready pod not being deleted; zero or several candidates fail
|
|
# (review M8 P2: never concatenate names or guess). tools/ci/ops-lib-check.sh tests it
|
|
# offline with fixtures.
|
|
# shellcheck disable=SC2034 # Used by the scripts that source this file.
|
|
POD_STATUS_JSONPATH='{range .items[*]}{.metadata.name}{"|"}{.status.conditions[?(@.type=="Ready")].status}{"|"}{.metadata.deletionTimestamp}{"\n"}{end}'
|
|
|
|
single_ready_pod() {
|
|
local ready count
|
|
ready="$(awk -F'|' 'NF >= 2 && $1 != "" && $2 == "True" && $3 == "" {print $1}')"
|
|
count="$(grep -c . <<< "$ready" || true)"
|
|
if [ "$count" != 1 ]; then
|
|
echo "expected exactly one Ready pod, found $count${ready:+: ${ready//$'\n'/ }}" >&2
|
|
return 1
|
|
fi
|
|
printf '%s\n' "$ready"
|
|
}
|