mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 00:07:50 +00:00
Make Mesos endpoint annotation e2e workaround cluster provider independent
This commit is contained in:
parent
616ba4ea9a
commit
63e34e3c10
@ -1049,18 +1049,15 @@ func getContainerPortsByPodUID(endpoints *api.Endpoints) PortsByPodUID {
|
|||||||
|
|
||||||
// use endpoint annotations to recover the container port in a Mesos setup
|
// use endpoint annotations to recover the container port in a Mesos setup
|
||||||
// compare contrib/mesos/pkg/service/endpoints_controller.syncService
|
// 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)
|
||||||
key := fmt.Sprintf("k8s.mesosphere.io/containerPort_%s_%s_%d", port.Protocol, addr.IP, hostPort)
|
mesosContainerPortString := endpoints.Annotations[key]
|
||||||
containerPortString := endpoints.Annotations[key]
|
if mesosContainerPortString != "" {
|
||||||
if containerPortString == "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
var err error
|
var err error
|
||||||
containerPort, err = strconv.Atoi(containerPortString)
|
containerPort, err = strconv.Atoi(mesosContainerPortString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
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)
|
Logf("Found pod %v, host port %d and container port %d", addr.TargetRef.UID, hostPort, containerPort)
|
||||||
|
Loading…
Reference in New Issue
Block a user