Documentation ¶
Index ¶
- func ContainsAddress(serviceCIDRLister networkinglisters.ServiceCIDRLister, address netip.Addr) []*networkingv1beta1.ServiceCIDR
- func ContainsIP(serviceCIDRLister networkinglisters.ServiceCIDRLister, ip net.IP) []*networkingv1beta1.ServiceCIDR
- func ContainsPrefix(serviceCIDRLister networkinglisters.ServiceCIDRLister, prefix netip.Prefix) []*networkingv1beta1.ServiceCIDR
- func IPToAddr(ip net.IP) netip.Addr
- func OverlapsPrefix(serviceCIDRLister networkinglisters.ServiceCIDRLister, prefix netip.Prefix) []*networkingv1beta1.ServiceCIDR
- func PrefixContainsIP(prefix netip.Prefix, ip netip.Addr) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsAddress ¶
func ContainsAddress(serviceCIDRLister networkinglisters.ServiceCIDRLister, address netip.Addr) []*networkingv1beta1.ServiceCIDR
ContainsAddress return the list of ServiceCIDR that contains the address passed as argument
func ContainsIP ¶
func ContainsIP(serviceCIDRLister networkinglisters.ServiceCIDRLister, ip net.IP) []*networkingv1beta1.ServiceCIDR
ContainsIP return the list of ServiceCIDR that contains the IP address passed as argument
func ContainsPrefix ¶
func ContainsPrefix(serviceCIDRLister networkinglisters.ServiceCIDRLister, prefix netip.Prefix) []*networkingv1beta1.ServiceCIDR
ContainsPrefix return the list of ServiceCIDR that contains the prefix passed as argument
func IPToAddr ¶
IPToAddr converts a net.IP to a netip.Addr if the net.IP is not valid it returns an empty netip.Addr{}
func OverlapsPrefix ¶
func OverlapsPrefix(serviceCIDRLister networkinglisters.ServiceCIDRLister, prefix netip.Prefix) []*networkingv1beta1.ServiceCIDR
OverlapsPrefix return the list of ServiceCIDR that overlaps with the prefix passed as argument
func PrefixContainsIP ¶
PrefixContainsIP returns true if the given IP is contained with the prefix, is not the network address and also, if IPv4, is not the broadcast address. This is required (rather than just `prefix.Contains(ip)`) because a ServiceCIDR covering prefix will not allocate those IPs, so a service with one of those IPs can't belong to that ServiceCIDR.
Types ¶
This section is empty.