From be0f2a8c56ecaa3f35e64895b627d601405cfc0e Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 25 Apr 2019 19:35:42 -0500 Subject: [PATCH] For k8s, look for mc-router named service port and use port value --- server/k8s.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/k8s.go b/server/k8s.go index 6d342f9..e78dbf1 100644 --- a/server/k8s.go +++ b/server/k8s.go @@ -10,6 +10,7 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/clientcmd" "net" + "strconv" ) const ( @@ -146,10 +147,8 @@ func buildDetails(service *v1.Service, externalServiceName string) *routableServ clusterIp := service.Spec.ClusterIP port := "25565" for _, p := range service.Spec.Ports { - if p.Port == 25565 { - if p.TargetPort.String() != "" { - port = p.TargetPort.String() - } + if p.Name == "mc-router" { + port = strconv.Itoa(int(p.Port)) } } rs := &routableService{