Skip to content

Commit

Permalink
Do not touch machine's DNSConfig if there is nothing to set
Browse files Browse the repository at this point in the history
  • Loading branch information
dangra committed May 16, 2023
1 parent da96e61 commit 4465639
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/command/machine/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,10 +757,11 @@ func determineMachineConfig(ctx context.Context, input *determineMachineConfigIn
machineConf.Init.Cmd = flag.Args(ctx)[1:]
}

if machineConf.DNS == nil {
machineConf.DNS = &api.DNSConfig{
SkipRegistration: flag.GetBool(ctx, "skip-dns-registration"),
if flag.IsSpecified(ctx, "skip-dns-registration") {
if machineConf.DNS == nil {
machineConf.DNS = &api.DNSConfig{}
}
machineConf.DNS.SkipRegistration = flag.GetBool(ctx, "skip-dns-registration")
}

// Metadata
Expand Down

0 comments on commit 4465639

Please sign in to comment.