1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-16 03:07:26 +08:00

Check that instance is present when setting ports

This commit is contained in:
Marcos Lilljedahl 2016-12-29 14:10:21 -03:00
parent b48812b085
commit bfbe3abed5

View File

@ -88,8 +88,10 @@ func SetInstanceSwarmPorts(i *Instance) error {
for _, t := range tasks {
for _, n := range nodes {
ins := nodesIdx[n.ID]
for _, p := range services[t.ServiceID] {
ins.setUsedPort(p)
if ins != nil {
for _, p := range services[t.ServiceID] {
ins.setUsedPort(p)
}
}
}
}