mirror of
https://github.com/docker/compose.git
synced 2025-07-21 20:54:32 +02:00
Merge pull request #1916 from mikesir87/allow-unspecified-protocol-on-port
Allow unspecified protocol on exposed port in kube backend
This commit is contained in:
commit
7b03b04484
@ -92,12 +92,13 @@ func mapToService(project *types.Project, service types.ServiceConfig) *core.Ser
|
|||||||
if p.Published != 0 {
|
if p.Published != 0 {
|
||||||
serviceType = core.ServiceTypeLoadBalancer
|
serviceType = core.ServiceTypeLoadBalancer
|
||||||
}
|
}
|
||||||
|
protocol := toProtocol(p.Protocol)
|
||||||
ports = append(ports,
|
ports = append(ports,
|
||||||
core.ServicePort{
|
core.ServicePort{
|
||||||
Name: fmt.Sprintf("%d-%s", p.Published, strings.ToLower(p.Protocol)),
|
Name: fmt.Sprintf("%d-%s", p.Published, strings.ToLower(string(protocol))),
|
||||||
Port: int32(p.Published),
|
Port: int32(p.Published),
|
||||||
TargetPort: intstr.FromInt(int(p.Target)),
|
TargetPort: intstr.FromInt(int(p.Target)),
|
||||||
Protocol: toProtocol(p.Protocol),
|
Protocol: protocol,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if len(ports) == 0 { // headless service
|
if len(ports) == 0 { // headless service
|
||||||
|
Loading…
x
Reference in New Issue
Block a user