vivint-smarthome / ceph-on-mesos

Ceph on Mesos
http://vivint-smarthome.github.io/ceph-on-mesos/
Apache License 2.0
20 stars 4 forks source link

SinglePortMatcher only considers the first range of resources #11

Closed timcharper closed 7 years ago

timcharper commented 7 years ago

Given an offer with resources as following:

16:48:40.261 [ceph-on-mesos-akka.actor.default-dispatcher-26] DEBUG com.vivint.ceph.TaskActor - received offer
id {
  value: "c518e41e-8c8e-477f-b5eb-8610fe0c06fb-O82"
}
framework_id {
  value: "c518e41e-8c8e-477f-b5eb-8610fe0c06fb-0002"
}
slave_id {
  value: "c518e41e-8c8e-477f-b5eb-8610fe0c06fb-S2"
}
hostname: "172.31.11.151"
resources {
  name: "ports"
  type: RANGES
  ranges {
    range {
      begin: 1025
      end: 2180
    }
    range {
      begin: 2182
      end: 3887
    }
    range {
      begin: 3889
      end: 5049
    }
    range {
      begin: 5052
      end: 8079
    }
    range {
      begin: 8082
      end: 8180
    }
    range {
      begin: 8182
      end: 9667
    }
    range {
      begin: 9669
      end: 32000
    }
  }
  role: "*"
}

If the intention is to match port 6789, then it will not succeed. This is because the single port matcher for ceph-on-mesos is only looking at the first range.

timcharper commented 7 years ago

Fixed in 0.2.11