mirror of
https://github.com/status-im/consul.git
synced 2025-02-22 18:38:19 +00:00
Adds check to make sure port is given so we avoid a nil bind address.
This commit is contained in:
parent
e6c50f4a71
commit
16eb2ef014
@ -399,6 +399,9 @@ func (b *Builder) Build() (rt RuntimeConfig, err error) {
|
||||
for _, s := range c.Segments {
|
||||
name := b.stringVal(s.Name)
|
||||
port := b.portVal(fmt.Sprintf("segments[%s].port", name), s.Port)
|
||||
if port == 0 {
|
||||
return RuntimeConfig{}, fmt.Errorf("Port must be specified for segment %q", s.Name)
|
||||
}
|
||||
|
||||
bind := b.makeTCPAddr(
|
||||
b.expandFirstIP(fmt.Sprintf("segments[%s].bind", name), s.Bind),
|
||||
|
Loading…
x
Reference in New Issue
Block a user