mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-17 20:00:07 +00:00
Modify() was replacing components one at a time: stop X, start X, stop Y, start Y, ... in version-skew order (apiserver last on downgrade). This caused a crash during downgrade: KCM-1.35 started against the still- running apiserver-1.36, passed its /healthz, and then immediately lose its connection when apiserver-1.36 was killed by the localupcluster. KCM-1.35 would reconnect to the not-yet-ready apiserver-1.35, hit a 403 RBAC error during controller initialization, and exit — because that initialization phase does not retry on RBAC errors. Fix by splitting Modify() into two phases: Phase 1 — stop all components to be replaced, in reverse startup order (kube-proxy down to apiserver), so dependent components release their connections before the apiserver is stopped. Phase 2 — start all replacement components in standard startup order (apiserver first), so each component connects to a fully-ready apiserver.