diff --git a/kubernetes/apps/otbr/deployment.yaml b/kubernetes/apps/otbr/deployment.yaml index 698695f9..f8cd9dd1 100644 --- a/kubernetes/apps/otbr/deployment.yaml +++ b/kubernetes/apps/otbr/deployment.yaml @@ -145,9 +145,16 @@ spec: # exists to prevent. Note the trailing `|| true`: this script # runs under `set -e`, so a bare failing test would kill the # container rather than log a warning. + # + # `tr -d '\r'` is load-bearing. ot-ctl speaks a serial-console + # protocol and terminates lines with CRLF, so `ot-ctl state` + # yields `leader\r` (7 bytes). That matches no shell glob, and + # the stray CR is invisible in logs — the first cut of this + # block printed "WARNING Thread not attached (state=leader)" + # while Thread was, in fact, the leader. STATE="" for i in $(seq 1 30); do - STATE=$(ot-ctl state 2>/dev/null | head -1 || true) + STATE=$(ot-ctl state 2>/dev/null | head -1 | tr -d '\r' || true) case "$STATE" in leader|router|child) echo "otbr: Thread attached as ${STATE}"