servicecidr

package
v1.31.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

func IPToAddr(ip net.IP) netip.Addr

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

func PrefixContainsIP(prefix netip.Prefix, ip netip.Addr) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL