Use container name in port discovery

If the port name is missing, append the container name to the tcp port name
This commit is contained in:
stefanprodan
2019-06-17 20:50:21 +03:00
parent 9ca79d147d
commit 6d1da5bb45
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -367,7 +367,7 @@ func (c *Deployer) getPorts(deployment *appsv1.Deployment, canaryPort int32) (ma
if p.ContainerPort == canaryPort {
continue
}
name := fmt.Sprintf("tcp-%v", i)
name := fmt.Sprintf("tcp-%s-%v", container.Name, i)
if p.Name != "" {
name = p.Name
}
+1 -1
View File
@@ -361,7 +361,7 @@ func TestScheduler_PortDiscovery(t *testing.T) {
case
"http 9898",
"http-metrics 8080",
"tcp-2 8888":
"tcp-podinfo-2 8888":
return true
}
return false