Skip to content

Commit c54f2f2

Browse files
jeremydSasso
authored andcommitted
fix lowercase for kube api compat (#190)
1 parent 40eab30 commit c54f2f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/plugins/kubedeploy/loadbalancers.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ func (x *KubeDeploy) doLoadBalancer(e agent.Event) error {
157157
IntVal: p.Destination.Port,
158158
}
159159
newPort := v1.ServicePort{
160-
Name: p.Name,
160+
// TODO: remove this toLower when we fix the data in mongo, kube only allows lowercase port names
161+
Name: strings.ToLower(p.Name),
161162
Port: p.Source.Port,
162163
TargetPort: convPort,
163164
Protocol: v1.Protocol(realProto),
@@ -198,7 +199,8 @@ func (x *KubeDeploy) doLoadBalancer(e agent.Event) error {
198199
if svc.Spec.Type == "LoadBalancer" {
199200
for i := range svc.Spec.Ports {
200201
for j := range serviceParams.Spec.Ports {
201-
if svc.Spec.Ports[i].Name == serviceParams.Spec.Ports[j].Name {
202+
// TODO: remove this toLower when we fix the data in mongo, kube only allows lowercase port names
203+
if strings.ToLower(svc.Spec.Ports[i].Name) == strings.ToLower(serviceParams.Spec.Ports[j].Name) {
202204
serviceParams.Spec.Ports[j].NodePort = svc.Spec.Ports[i].NodePort
203205
}
204206
}

0 commit comments

Comments
 (0)