Context
Bugbot flagged on #179 (#179 (comment)): scripts/install-k8s.ps1:130 initialises $script:ClientState = "starting", whereas the bash equivalent in scripts/lib/summary.sh initialises CLIENT_STATE="" (empty).
The empty init on the bash side is deliberate: it lets an abnormal fall-through before the readiness gate be distinguished from a reported outcome, so the cleanup path can print the "check the log / safe to re-run" hint and exit non-zero.
Assessment (low / theoretical)
Grepped every ClientState consumer in install-k8s.ps1:
Wait-ForClientReady (sets it)
Print-Summary (reads it)
- final exit check at line ~1559:
if ($script:ClientState -ne "connected" -and $script:ClientState -ne "starting") { exit 1 }
No trap / cleanup handler reads ClientState, so the "starting" default never leaks into an early-exit path today. The risk is latent: if a future early-exit path is added, the "starting" default would mask an abnormal exit as a benign exit 0.
Fix
Change scripts/install-k8s.ps1:130 from:
$script:ClientState = "starting"
to:
An abnormal fall-through then exits 1 (not a false 0), matching bash. Verify the exit check at ~1559 and Print-Summary still behave correctly with the empty initial value (they should — empty falls through to exit 1, which is the desired safe default).
Why deferred
Fast-follow after v1.4.3. The change belongs on develop; slipping it into the in-flight v1.4.3 release (sync PR #179) would diverge the sync branch from develop and add a commit to the FR promotion set for no live-failure-path benefit.
Acceptance criteria
Context
Bugbot flagged on #179 (#179 (comment)):
scripts/install-k8s.ps1:130initialises$script:ClientState = "starting", whereas the bash equivalent inscripts/lib/summary.shinitialisesCLIENT_STATE=""(empty).The empty init on the bash side is deliberate: it lets an abnormal fall-through before the readiness gate be distinguished from a reported outcome, so the cleanup path can print the "check the log / safe to re-run" hint and exit non-zero.
Assessment (low / theoretical)
Grepped every
ClientStateconsumer ininstall-k8s.ps1:Wait-ForClientReady(sets it)Print-Summary(reads it)if ($script:ClientState -ne "connected" -and $script:ClientState -ne "starting") { exit 1 }No trap / cleanup handler reads
ClientState, so the"starting"default never leaks into an early-exit path today. The risk is latent: if a future early-exit path is added, the"starting"default would mask an abnormal exit as a benignexit 0.Fix
Change
scripts/install-k8s.ps1:130from:to:
An abnormal fall-through then exits 1 (not a false 0), matching bash. Verify the exit check at ~1559 and
Print-Summarystill behave correctly with the empty initial value (they should — empty falls through toexit 1, which is the desired safe default).Why deferred
Fast-follow after v1.4.3. The change belongs on
develop; slipping it into the in-flight v1.4.3 release (sync PR #179) would diverge the sync branch from develop and add a commit to the FR promotion set for no live-failure-path benefit.Acceptance criteria
$script:ClientStateinitialised to""ininstall-k8s.ps1