Skip to content

Commit

Permalink
fix: fix nil panic on maintenance upgrade with partial config
Browse files Browse the repository at this point in the history
Fix the nil dereferences when a Talos node is attempted to be upgraded while in maintenance mode and having a partial machine config.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
(cherry picked from commit 1bb6027)
  • Loading branch information
utkuozdemir authored and smira committed Mar 20, 2024
1 parent 3c942fe commit 5cbbbfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/pkg/install/install.go
Expand Up @@ -55,7 +55,7 @@ func RunInstallerContainer(disk, platform, ref string, cfg configcore.Config, cf
extensionsConfig []config.Extension
)

if cfg != nil {
if cfg != nil && cfg.Machine() != nil {
registriesConfig = cfg.Machine().Registries()
extensionsConfig = cfg.Machine().Install().Extensions()
} else {
Expand Down Expand Up @@ -296,7 +296,7 @@ func OptionsFromUpgradeRequest(r runtime.Runtime, in *machineapi.UpgradeRequest)
WithForce(!in.GetPreserve()),
}

if r.Config() != nil {
if r.Config() != nil && r.Config().Machine() != nil {
opts = append(opts, WithExtraKernelArgs(r.Config().Machine().Install().ExtraKernelArgs()))
}

Expand Down

0 comments on commit 5cbbbfa

Please sign in to comment.