Skip to content

Commit

Permalink
fix: correctly handle partial configs in DNSUpstreamController
Browse files Browse the repository at this point in the history
Prevent `DNSUpstreamController` from panicking by checking if the `machine` section in the config is `nil`. This is the case when a machine has partial configuration, e.g., when the machine has only a `SideroLinkConfig` in its config.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
  • Loading branch information
utkuozdemir committed Feb 16, 2024
1 parent 6deb10a commit 493bb60
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ func (ctrl *DNSUpstreamController) run(ctx context.Context, r controller.Runtime
return err
}

if !mc.Config().Machine().Features().LocalDNSEnabled() {
machineConfig := mc.Config().Machine()
if machineConfig == nil || !machineConfig.Features().LocalDNSEnabled() {
return nil
}

Expand Down

0 comments on commit 493bb60

Please sign in to comment.