Skip to content

Commit de97fee

Browse files
Merge pull request #5415 from dkhater-redhat/rhel10-compatible
MCO-1976: [Dev] Fix RHEL9-specific MCD Logic for RHEL10/CentOS10 Compatibility
2 parents 759466d + 2cabd9c commit de97fee

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

pkg/daemon/daemon.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,19 @@ func ReexecuteForTargetRoot(target string) error {
535535
if sourceOsVersion.IsLikeRHEL() && targetOsVersion.IsLikeRHEL() {
536536
sourceMajor := sourceOsVersion.BaseVersionMajor()
537537
targetMajor := targetOsVersion.BaseVersionMajor()
538-
if sourceMajor == "9" && targetMajor == "8" {
538+
539+
// When container is newer than target, use target-compatible binary
540+
switch {
541+
case sourceMajor == "10" && targetMajor == "9":
542+
sourceBinarySuffix = ".rhel9"
543+
klog.Info("container is rhel10, target is rhel9")
544+
case sourceMajor == "10" && targetMajor == "8":
545+
sourceBinarySuffix = ".rhel8"
546+
klog.Info("container is rhel10, target is rhel8")
547+
case sourceMajor == "9" && targetMajor == "8":
539548
sourceBinarySuffix = ".rhel8"
540549
klog.Info("container is rhel9, target is rhel8")
541-
} else {
550+
default:
542551
klog.Infof("using appropriate binary for source=rhel-%s target=rhel-%s", sourceMajor, targetMajor)
543552
}
544553
} else {

pkg/daemon/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2298,7 +2298,7 @@ func (dn *Daemon) updateKubeConfigPermission() error {
22982298
// (/home/core/.ssh/authorized_keys.d/ignition) or the old SSH key path
22992299
// (/home/core/.ssh/authorized_keys)
23002300
func (dn *Daemon) useNewSSHKeyPath() bool {
2301-
return dn.os.IsEL9() || dn.os.IsFCOS() || dn.os.IsSCOS()
2301+
return dn.os.IsEL9() || dn.os.IsEL10() || dn.os.IsFCOS() || dn.os.IsSCOS()
23022302
}
23032303

23042304
// Update a given PasswdUser's SSHKey

0 commit comments

Comments
 (0)