Skip to content

Commit

Permalink
Change key names in endpoints.go
Browse files Browse the repository at this point in the history
  • Loading branch information
CIPHERTron committed Sep 16, 2021
1 parent f66822b commit 39a6952
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/proxy/util/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ func IPPart(s string) string {
// Must be IP:port
host, _, err := net.SplitHostPort(s)
if err != nil {
klog.ErrorS(err, "Failed to parse host-port", "input", s)
klog.ErrorS(err, "Failed to parse host-port", "hostport", s)
return ""
}
// Check if host string is a valid IP address
ip := netutils.ParseIPSloppy(host)
if ip == nil {
klog.ErrorS(nil, "Failed to parse IP", "input", host)
klog.ErrorS(nil, "Failed to parse IP", "host", host)
return ""
}
return ip.String()
Expand All @@ -53,12 +53,12 @@ func PortPart(s string) (int, error) {
// Must be IP:port
_, port, err := net.SplitHostPort(s)
if err != nil {
klog.ErrorS(err, "Failed to parse host-port", "input", s)
klog.ErrorS(err, "Failed to parse host-port", "hostport", s)
return -1, err
}
portNumber, err := strconv.Atoi(port)
if err != nil {
klog.ErrorS(err, "Failed to parse port", "input", port)
klog.ErrorS(err, "Failed to parse port", "port", port)
return -1, err
}
return portNumber, nil
Expand Down

0 comments on commit 39a6952

Please sign in to comment.