Merge pull request #13716 from mesosphere/mesos-e2e-provider-independence

Auto commit by PR queue bot
pull/6/head
k8s-merge-robot 2015-09-14 02:49:59 -07:00
commit 50d805110a
1 changed files with 5 additions and 8 deletions

View File

@ -1119,18 +1119,15 @@ func getContainerPortsByPodUID(endpoints *api.Endpoints) PortsByPodUID {
// use endpoint annotations to recover the container port in a Mesos setup
// compare contrib/mesos/pkg/service/endpoints_controller.syncService
if providerIs("mesos/docker") {
key := fmt.Sprintf("k8s.mesosphere.io/containerPort_%s_%s_%d", port.Protocol, addr.IP, hostPort)
containerPortString := endpoints.Annotations[key]
if containerPortString == "" {
continue
}
mesosContainerPortString := endpoints.Annotations[key]
if mesosContainerPortString != "" {
var err error
containerPort, err = strconv.Atoi(containerPortString)
containerPort, err = strconv.Atoi(mesosContainerPortString)
if err != nil {
continue
}
Logf("Mapped mesos host port %d to container port %d via annotation %s=%s", hostPort, containerPort, key, containerPortString)
Logf("Mapped mesos host port %d to container port %d via annotation %s=%s", hostPort, containerPort, key, mesosContainerPortString)
}
Logf("Found pod %v, host port %d and container port %d", addr.TargetRef.UID, hostPort, containerPort)