util

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExcludedMark = "EXCLUDED"
	ReservedMark = "RESERVED"

	AgentSuffixName        = "agent"
	NodeArgsAnnotationKey  = "rke2.io/node-args"
	ServiceCIDRFlag        = "--service-cidr"
	ManagementNodeLabelKey = "node-role.kubernetes.io/control-plane"
)

Variables

This section is empty.

Functions

func EnvGetBool

func EnvGetBool(key string, defaultValue bool) bool

func FileExists

func FileExists(filename string) bool

func GetServiceCIDRFromNode added in v0.3.0

func GetServiceCIDRFromNode(node *corev1.Node) (string, error)

func IsIPAddrInList added in v0.3.0

func IsIPAddrInList(ipAddr netip.Addr, ipAddrList []netip.Addr) bool

func IsIPInBetweenOf added in v0.3.0

func IsIPInBetweenOf(ip, ip1, ip2 string) bool

func LoadAllocated added in v0.2.0

func LoadAllocated(allocated map[string]string) (allocatedList, excludedList, reservedList []netip.Addr)

LoadAllocated returns the un-allocatable IP addresses in three types of IP address lists, allocatedList, excludedList, and reservedList.

func LoadCIDR added in v0.3.0

func LoadCIDR(cidr string) (ipNet *net.IPNet, networkIPAddr netip.Addr, broadcastIPAddr netip.Addr, err error)

func SafeAgentConcatName added in v0.2.0

func SafeAgentConcatName(name ...string) string

Types

type PoolInfo added in v0.2.0

type PoolInfo struct {
	IPNet           *net.IPNet
	NetworkIPAddr   netip.Addr
	BroadcastIPAddr netip.Addr
	StartIPAddr     netip.Addr
	EndIPAddr       netip.Addr
	ServerIPAddr    netip.Addr
	RouterIPAddr    netip.Addr
}

func LoadPool added in v0.2.0

func LoadPool(ipPool *networkv1.IPPool) (pi PoolInfo, err error)

type VmnetcfgGetter

type VmnetcfgGetter struct {
	VmnetcfgCache ctlnetworkv1.VirtualMachineNetworkConfigCache
}

func (*VmnetcfgGetter) WhoUseIPPool

WhoUseIPPool requires adding network indexer to the vmnetcfg cache before invoking it

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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