fix(bootstrap): keep the install alive on a host with only felis-api
restart_existing_control_plane ended in an and-list per deployment:
[ "$had_api" = "1" ] && kube ... rollout restart deployment/felis-api
[ "$had_operator" = "1" ] && kube ... rollout restart deployment/felis-operator
As the LAST command of a function, an and-list whose test is false returns 1,
and that becomes the function's exit status. The call site is bare, so under
`set -Eeuo pipefail` the installer dies there — after the bundle has been
applied and before the rollout wait, leaving a half-finished upgrade and no
message naming the cause.
It fires on any host carrying one control-plane deployment but not the other:
felis-api present without felis-operator restarts the api, then exits 1 on the
second test. Both present, or neither, happened to work, which is why it
survived.
Rewritten as explicit `if` statements, which return 0 when the test is false.
Verified out of tree against all four had_api/had_operator combinations.
This commit is contained in:
1 file changed
+6
-2
+6
-2
@@ -1425,8 +1425,12 @@ restart_existing_control_plane() {
|
||||
[ "$had_api$had_operator" != "00" ] || return 0
|
||||
|
||||
log "restarting existing control-plane deployments to pick up ${FELIS_IMAGE}"
|
||||
[ "$had_api" = "1" ] && kube -n "$CONTROL_NS" rollout restart deployment/felis-api
|
||||
[ "$had_operator" = "1" ] && kube -n "$CONTROL_NS" rollout restart deployment/felis-operator
|
||||
# `if`, not `[ test ] && cmd`: as the LAST command of the function the and-list returns 1
|
||||
# when the test is false, which becomes the function's exit status and kills the whole
|
||||
# install under `set -Eeuo pipefail` — right after the bundle is applied and before the
|
||||
# rollout wait. Fires on any host carrying felis-api without felis-operator.
|
||||
if [ "$had_api" = "1" ]; then kube -n "$CONTROL_NS" rollout restart deployment/felis-api; fi
|
||||
if [ "$had_operator" = "1" ]; then kube -n "$CONTROL_NS" rollout restart deployment/felis-operator; fi
|
||||
}
|
||||
|
||||
# The login/lobby images use local mutable tags. Importing a replacement updates
|
||||
|
||||
Reference in new issue
Block a user