Adds check to make sure port is given so we avoid a nil bind address.
This commit is contained in:
parent
275e83de08
commit
a16dbc0212
|
@ -399,6 +399,9 @@ func (b *Builder) Build() (rt RuntimeConfig, err error) {
|
||||||
for _, s := range c.Segments {
|
for _, s := range c.Segments {
|
||||||
name := b.stringVal(s.Name)
|
name := b.stringVal(s.Name)
|
||||||
port := b.portVal(fmt.Sprintf("segments[%s].port", name), s.Port)
|
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(
|
bind := b.makeTCPAddr(
|
||||||
b.expandFirstIP(fmt.Sprintf("segments[%s].bind", name), s.Bind),
|
b.expandFirstIP(fmt.Sprintf("segments[%s].bind", name), s.Bind),
|
||||||
|
|
Loading…
Reference in New Issue