chore: add more tests (#3010)

This commit is contained in:
Kevin Wan
2023-03-10 21:56:19 +08:00
committed by GitHub
parent c8a17a97be
commit fbf129d535
6 changed files with 109 additions and 13 deletions

View File

@@ -1,7 +1,6 @@
package kube
import (
"fmt"
"strconv"
"strings"
@@ -34,10 +33,6 @@ func ParseTarget(target resolver.Target) (Service, error) {
endpoints := targets.GetEndpoints(target)
if strings.Contains(endpoints, colon) {
segs := strings.SplitN(endpoints, colon, 2)
if len(segs) < 2 {
return emptyService, fmt.Errorf("bad endpoint: %s", endpoints)
}
service.Name = segs[0]
port, err := strconv.Atoi(segs[1])
if err != nil {