Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1911632: daemon/update: fix regression in realtime upgrades #2329

Merged
merged 1 commit into from
Jan 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/daemon/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -1155,12 +1155,11 @@ func (dn *Daemon) switchKernel(oldConfig, newConfig *mcfgv1.MachineConfig) error

defaultKernel := []string{"kernel", "kernel-core", "kernel-modules", "kernel-modules-extra"}
realtimeKernel := []string{"kernel-rt-core", "kernel-rt-modules", "kernel-rt-modules-extra", "kernel-rt-kvm"}
var args []string

dn.logSystem("Initiating switch from kernel %s to %s", canonicalizeKernelType(oldConfig.Spec.KernelType), canonicalizeKernelType(newConfig.Spec.KernelType))

if canonicalizeKernelType(oldConfig.Spec.KernelType) == ctrlcommon.KernelTypeRealtime && canonicalizeKernelType(newConfig.Spec.KernelType) == ctrlcommon.KernelTypeDefault {
args = []string{"override", "reset"}
args := []string{"override", "reset"}
args = append(args, defaultKernel...)
for _, pkg := range realtimeKernel {
args = append(args, "--uninstall", pkg)
Expand All @@ -1172,7 +1171,7 @@ func (dn *Daemon) switchKernel(oldConfig, newConfig *mcfgv1.MachineConfig) error

if canonicalizeKernelType(oldConfig.Spec.KernelType) == ctrlcommon.KernelTypeDefault && canonicalizeKernelType(newConfig.Spec.KernelType) == ctrlcommon.KernelTypeRealtime {
// Switch to RT kernel
args = []string{"override", "remove"}
args := []string{"override", "remove"}
args = append(args, defaultKernel...)
for _, pkg := range realtimeKernel {
args = append(args, "--install", pkg)
Expand All @@ -1185,6 +1184,7 @@ func (dn *Daemon) switchKernel(oldConfig, newConfig *mcfgv1.MachineConfig) error

if canonicalizeKernelType(oldConfig.Spec.KernelType) == ctrlcommon.KernelTypeRealtime && canonicalizeKernelType(newConfig.Spec.KernelType) == ctrlcommon.KernelTypeRealtime {
if oldConfig.Spec.OSImageURL != newConfig.Spec.OSImageURL {
args := []string{"update"}
dn.logSystem("Updating rt-kernel packages on host: %+q", args)
_, err := runGetOut("rpm-ostree", args...)
darkmuggle marked this conversation as resolved.
Show resolved Hide resolved
return err
Expand Down