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>
  • Loading branch information
utkuozdemir committed Mar 8, 2024
1 parent aa70bfb commit 1bb6027
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/pkg/install/install.go
Original file line number Diff line number Diff line change
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 1bb6027

Please sign in to comment.