feat: support newline and comma-whitespace external host lists for auto-discovery (#468)
This commit is contained in:
+5
-5
@@ -3,6 +3,10 @@ package server
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
"sync"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
apps "k8s.io/api/apps/v1"
|
||||
@@ -14,10 +18,6 @@ import (
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -238,7 +238,7 @@ func (w *K8sWatcher) extractRoutableServices(obj interface{}) []*routableService
|
||||
|
||||
routableServices := make([]*routableService, 0)
|
||||
if externalServiceName, exists := service.Annotations[AnnotationExternalServerName]; exists {
|
||||
serviceNames := strings.Split(externalServiceName, ",")
|
||||
serviceNames := SplitExternalHosts(externalServiceName)
|
||||
for _, serviceName := range serviceNames {
|
||||
routableServices = append(routableServices, w.buildDetails(service, serviceName))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user