mirror of https://github.com/docker/docs.git
17 lines
378 B
Go
17 lines
378 B
Go
package task
|
|
|
|
import "github.com/mesos/mesos-go/mesosproto"
|
|
|
|
func getPorts(offer *mesosproto.Offer) (ports []uint64) {
|
|
for _, resource := range offer.Resources {
|
|
if resource.GetName() == "ports" {
|
|
for _, rang := range resource.GetRanges().GetRange() {
|
|
for i := rang.GetBegin(); i <= rang.GetEnd(); i++ {
|
|
ports = append(ports, i)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return ports
|
|
}
|