Skip to content

Commit 466995d

Browse files
committed
Change netutilsv2.IPFamily to match corev1.IPFamily
(so you can cast between them)
1 parent d170acb commit 466995d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

net/v2/ipfamily.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,19 @@ import (
2020
"net"
2121
)
2222

23-
// IPFamily refers to a specific family if not empty, i.e. "4" or "6".
23+
// IPFamily refers to the IP family of an address or CIDR value. Its values are
24+
// intentionally identical to those of "k8s.io/api/core/v1".IPFamily and
25+
// "k8s.io/discovery/v1".AddressType, so you can cast values between these types.
2426
type IPFamily string
2527

26-
// Constants for valid IPFamilys:
2728
const (
28-
IPFamilyUnknown IPFamily = ""
29+
// IPv4 indicates an IPv4 IP or CIDR.
30+
IPv4 IPFamily = "IPv4"
31+
// IPv6 indicates an IPv4 IP or CIDR.
32+
IPv6 IPFamily = "IPv6"
2933

30-
IPv4 IPFamily = "4"
31-
IPv6 IPFamily = "6"
34+
// IPFamilyUnknown indicates an unspecified or invalid IP family.
35+
IPFamilyUnknown IPFamily = ""
3236
)
3337

3438
// IsDualStackIPs returns true if:

0 commit comments

Comments
 (0)