From 2cabd9cd9cdd76f1974618f6c5d592f6cf8f67f6 Mon Sep 17 00:00:00 2001 From: Dalia Khater Date: Thu, 13 Nov 2025 12:06:43 -0600 Subject: [PATCH] MCD RHEL9-specific logic updated for RHEL10 compatibility --- pkg/daemon/daemon.go | 13 +++++++++++-- pkg/daemon/update.go | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index 8affe12adc..2b79de48fd 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -535,10 +535,19 @@ func ReexecuteForTargetRoot(target string) error { if sourceOsVersion.IsLikeRHEL() && targetOsVersion.IsLikeRHEL() { sourceMajor := sourceOsVersion.BaseVersionMajor() targetMajor := targetOsVersion.BaseVersionMajor() - if sourceMajor == "9" && targetMajor == "8" { + + // When container is newer than target, use target-compatible binary + switch { + case sourceMajor == "10" && targetMajor == "9": + sourceBinarySuffix = ".rhel9" + klog.Info("container is rhel10, target is rhel9") + case sourceMajor == "10" && targetMajor == "8": + sourceBinarySuffix = ".rhel8" + klog.Info("container is rhel10, target is rhel8") + case sourceMajor == "9" && targetMajor == "8": sourceBinarySuffix = ".rhel8" klog.Info("container is rhel9, target is rhel8") - } else { + default: klog.Infof("using appropriate binary for source=rhel-%s target=rhel-%s", sourceMajor, targetMajor) } } else { diff --git a/pkg/daemon/update.go b/pkg/daemon/update.go index ab12474c50..7e1b874b07 100644 --- a/pkg/daemon/update.go +++ b/pkg/daemon/update.go @@ -2288,7 +2288,7 @@ func (dn *Daemon) updateKubeConfigPermission() error { // (/home/core/.ssh/authorized_keys.d/ignition) or the old SSH key path // (/home/core/.ssh/authorized_keys) func (dn *Daemon) useNewSSHKeyPath() bool { - return dn.os.IsEL9() || dn.os.IsFCOS() || dn.os.IsSCOS() + return dn.os.IsEL9() || dn.os.IsEL10() || dn.os.IsFCOS() || dn.os.IsSCOS() } // Update a given PasswdUser's SSHKey