Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
mprokopchuk 2026-07-06 14:15:18 -07:00 committed by Pearl Dsilva
parent c64d1feb79
commit 78516eae78
1 changed files with 3 additions and 2 deletions

View File

@ -1048,8 +1048,9 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
ManagementServerHostVO mshost = _mshostDao.findByMsid(_msId);
// Look for duplicate hostname in the case of kubernetes setup where ip/mac changes but hostname is constant.
if (mshost == null && StringUtils.isNotBlank(currentHostname)) {
// Look for duplicate hostname in Kubernetes setups where IP/MAC changes but hostname is constant.
// Skip the default "localhost" hostname fallback to avoid removing other active nodes when hostname resolution fails.
if (mshost == null && StringUtils.isNotBlank(currentHostname) && !StringUtils.equalsIgnoreCase(currentHostname, "localhost")) {
List<ManagementServerHostVO> activeEntries = _mshostDao.findAllByName(currentHostname);
for (ManagementServerHostVO activeEntry : activeEntries) {
// Found an active entry with this hostname but different MSID