Sounds good to me, then!


On Tue, Apr 1, 2014 at 3:28 PM, Brenden Matthews
<notifications@github.com>wrote:

> In src/main/scala/mesosphere/mesos/TaskBuilder.scala:
>
> > @@ -205,9 +219,18 @@ object TaskBuilder {
> >    }
> >
> >    def getPorts(offer: Offer, numPorts: Int): Option[Seq[(Int, Int, String)]] = {
> > -    offer.getResourcesList.asScala
> > -      .find(_.getName == portsResourceName)
> > -      .flatMap(getPorts(_, numPorts))
> > +    val resources = offer.getResourcesList.asScala
> > +    // Check first for reserved ports
> > +    val ports = resources.find({
> > +      r => r.getName == portsResourceName && r.hasRole && r.getRole != "*"
> > +    }) match {
> > +      case None =>
> > +        // No reserved port resources found.
> > +        resources.find(_.getName == portsResourceName)
>
> This syntax works too. This is the way it was before, so I just left it as
> it was.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/airbnb/marathon/pull/1/files#r11185371>
> .
>