Skip to content

Commit

Permalink
specify the port names in service/endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tzneal committed Dec 9, 2021
1 parent 5eea956 commit 4898300
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ inside the cluster as described by the configuration file.`,
// and specify our new port mappings
for _, port := range supplantSvc.Ports {
var newPort v1.ServicePort
newPort.Name = port.Name
newPort.Port = port.Port
newPort.TargetPort = intstr.FromInt(int(port.LocalPort))
newPort.Protocol = svcPorts[port.Port].Protocol
Expand Down Expand Up @@ -186,6 +187,7 @@ inside the cluster as described by the configuration file.`,

for _, port := range supplantSvc.Ports {
ep.Subsets[0].Ports = append(ep.Subsets[0].Ports, v1.EndpointPort{
Name: port.Name,
Port: port.LocalPort,
})
}
Expand Down

0 comments on commit 4898300

Please sign in to comment.