Skip to content

Commit

Permalink
daemon: Always remove pending deployment before we do updates
Browse files Browse the repository at this point in the history
The RT kernel switch logic operates from the *booted* deployment,
not pending.  I had in my head that the MCO always cleaned up
pending, but due to another bug we didn't.

There's no reason to leave this cleanup to a defer; do it
before we do anything else.

(But keep the defer because it's cleaner to *also* cleanup if
 we fail)
  • Loading branch information
cgwalters committed Mar 9, 2023
1 parent 22b7e83 commit 112277e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/daemon/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -2120,6 +2120,12 @@ func (dn *CoreOSDaemon) applyLayeredOSChanges(mcDiff machineConfigDiff, oldConfi
defer os.Remove(extensionsRepo)
}

// Always clean up pending, because the RT kernel switch logic below operates on booted,
// not pending.
if err := removePendingDeployment(); err != nil {
return fmt.Errorf("failed to remove pending deployment: %w", err)
}

defer func() {
// Operations performed by rpm-ostree on the booted system are available
// as staged deployment. It gets applied only when we reboot the system.
Expand Down

0 comments on commit 112277e

Please sign in to comment.