mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user