mgr/cephadm: skip mgr/mon key rotation when no mon daemons are known
fae0d0db8db ("mgr/cephadm: rotate keyring for core ceph daemons during
upgrade") made _upgrade_daemons() call _rotate_mgr_mon_auth_keys() on
every pass. That function indexes mon_daemons[0] unconditionally, and
with an empty mon list _detect_need_upgrade() reports no mons needing
upgrade, which is taken as "all mons upgraded" -- so it goes on to set
auth_allowed_ciphers and rotate mgr keys before crashing with
IndexError: list index out of range
cephadm/upgrade.py:1795
Since that merge four cephadm unit tests fail deterministically in
run_tox_mgr on every PR (test_upgrade_daemons_offline_hosts,
test_upgrade_run[False/True],
test_do_upgrade_limit_exhausted_marks_complete_without_scope_check);
they exercise the upgrade machinery without any mon daemons in the
cache.
Without any known mon daemons we cannot tell whether the mons have been
upgraded and there is no mon keyring to rotate, so skip the rotation for
this pass and let the next upgrade pass retry once the cache has mons.
Fixes: fae0d0db8dbc9f883f43f36e4735f2b456e79a9d
Signed-off-by: David Galloway <david.galloway@ibm.com>
Assisted-by: Claude Fable 5 (claude-fable-5) D
David Galloway committed
fa100f02071bd1dffe2ca3f5e9afdb1b06d8c85e
Parent: 62c4d50
Committed by Patrick Donnelly <pdonnell@ibm.com>
on 8/19/2026, 7:14:55 PM