Skip to content

Commit

Permalink
Backport of structs: fix test for empty DNS configuration into releas…
Browse files Browse the repository at this point in the history
…e/1.6.x (#20254)

Co-authored-by: Tim Gross <tgross@hashicorp.com>
  • Loading branch information
hc-github-team-nomad-core and tgross authored Mar 29, 2024
1 parent e8da6cb commit 9820941
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2871,7 +2871,7 @@ func (d *DNSConfig) IsZero() bool {
if d == nil {
return true
}
return len(d.Options) == 0 || len(d.Searches) == 0 || len(d.Servers) == 0
return len(d.Options) == 0 && len(d.Searches) == 0 && len(d.Servers) == 0
}

// NetworkResource is used to represent available network
Expand Down
1 change: 1 addition & 0 deletions nomad/structs/structs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7580,6 +7580,7 @@ func TestDNSConfig_Equal(t *testing.T) {

must.Equal[*DNSConfig](t, nil, nil)
must.NotEqual[*DNSConfig](t, nil, new(DNSConfig))
must.NotEqual[*DNSConfig](t, nil, &DNSConfig{Servers: []string{"8.8.8.8"}})

must.StructEqual(t, &DNSConfig{
Servers: []string{"8.8.8.8", "8.8.4.4"},
Expand Down

0 comments on commit 9820941

Please sign in to comment.