-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fixed regression with dns server start condition #3137
Conversation
command/agent/agent.go
Outdated
@@ -291,8 +291,10 @@ func (a *Agent) Start() error { | |||
} | |||
|
|||
// start DNS servers | |||
if err := a.listenAndServeDNS(); err != nil { | |||
return err | |||
if c.Ports.DNS > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better way to fix this is for config.DNSAddrs()
to return an empty array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which it does for Ports.DNS == 0
but not <0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
command/agent/config.go
Outdated
@@ -790,7 +790,7 @@ func (p ProtoAddr) String() string { | |||
} | |||
|
|||
func (c *Config) DNSAddrs() ([]ProtoAddr, error) { | |||
if c.Ports.DNS == 0 { | |||
if c.Ports.DNS < 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably use <=0
to keep parity with the HTTP implementation below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, previously the code checked for > 0
to enable. Inverting it is <= 0
@@ -790,7 +790,7 @@ func (p ProtoAddr) String() string { | |||
} | |||
|
|||
func (c *Config) DNSAddrs() ([]ProtoAddr, error) { | |||
if c.Ports.DNS == 0 { | |||
if c.Ports.DNS <= 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed now
LGTM. Can you squash merge this since only the last commit is relevant? |
This looked good so I went ahead and merged + updated the changelog. |
Found by comparing sha hashes 10540f8 and b6c69eb
Fixes #3135