Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of structs: fix test for empty DNS configuration into release/1.6.x #20254

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading