mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
kubectl: Adding IPv6 brackets for IPv6 endpoints
This fixes the lack of IPv6 when printing the IP:Port tuple with kubectl describe command. Signed-off-by: André Martins <aanm90@gmail.com>
This commit is contained in:
parent
223c721d6e
commit
cecc03ca8f
@ -20,7 +20,9 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"net"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -223,7 +225,8 @@ func formatEndpoints(endpoints *api.Endpoints, ports sets.String) string {
|
|||||||
}
|
}
|
||||||
addr := &ss.Addresses[i]
|
addr := &ss.Addresses[i]
|
||||||
if !more {
|
if !more {
|
||||||
list = append(list, fmt.Sprintf("%s:%d", addr.IP, port.Port))
|
hostPort := net.JoinHostPort(addr.IP, strconv.Itoa(int(port.Port)))
|
||||||
|
list = append(list, hostPort)
|
||||||
}
|
}
|
||||||
count++
|
count++
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user