util

package
v0.0.0-...-a3b290e Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_PORT = 65000
View Source
const MIN_PORT = 5000
View Source
const PORTPERNODES = 3000

Variables

This section is empty.

Functions

func AciNameForKey

func AciNameForKey(prefix, ktype, key string) string

AciNameForKey generates an ACI object name based on the params passed

func CombineVlanPoolMaps

func CombineVlanPoolMaps(nsVlanPoolMap map[string]map[string]string, namespace string) (combinedStr string)

func CreateHashFromNetPol

func CreateHashFromNetPol(np *v1net.NetworkPolicy) (string, error)

func CreateRdConfigCR

func CreateRdConfigCR(r rdconfigclset.Clientset, rdConfigSpec rdConfig.RdConfigSpec) error

CreateRdConfigCR creates a RdConfig CR

func CreateSnatGlobalInfoCR

func CreateSnatGlobalInfoCR(c snatglobalclset.Clientset,
	globalInfoSpec snatglobal.SnatGlobalInfoSpec) error

createSnatGlobalInfoCR Creates a SnatGlobalInfo CR

func DeepCopyObj

func DeepCopyObj(src, dst interface{}) error

func DeleteNodeInfoCR

func DeleteNodeInfoCR(c nodeinfoclset.Clientset, name string) error

UpdateNodeInfoCR Updates a UpdateNodeInfoInfo CR

func DeleteNodePodIfCR

func DeleteNodePodIfCR(c nc.Clientset, name string) error

DeleteNodePodIfCR Deletes a NodePodIf CR

func ExpandCIDRs

func ExpandCIDRs(currCIDRs []string) []string

Given generic list of CIDRs for subnets return sorted array(based on IP address) of IP addresses.

func ExpandPortRanges

func ExpandPortRanges(currPortRange []snatglobal.PortRange, step int) []snatglobal.PortRange

Given generic list of start and end of each port range, return sorted array(based on start of the range) of portranges based on number of per node

func GetIPsFromCIDR

func GetIPsFromCIDR(cidr string) []string

Given CIDR, this function returns list of IP addresses in that CIDR It does omit network and host reserved IP address from that.

func GetNetPolPolicyTypes

func GetNetPolPolicyTypes(indexer cache.Indexer, key string) []v1net.PolicyType

func GetPortRangeFromConfigMap

func GetPortRangeFromConfigMap(c *kubernetes.Clientset) (snatglobal.PortRange, int)

func Hash

func Hash(key string) string

func IsEndPointSlicesSupported

func IsEndPointSlicesSupported(kubeClient *kubernetes.Clientset) bool

Checks if cluster supports endpointslices

func MatchLabels

func MatchLabels(policylabels, reslabels map[string]string) bool

func ParseVlanList

func ParseVlanList(specVlans []string) (vlans []int, vlanBlks []string, combinedStr string, err error)

func ParseVlanListWithRangePreserved

func ParseVlanListWithRangePreserved(specVlans []string) (vlans []int, vlanBlks []string, combinedStr string, err error)

func UpdateGlobalInfoCR

func UpdateGlobalInfoCR(c snatglobalclset.Clientset, globalInfo *snatglobal.SnatGlobalInfo) error

UpdateSnatGlobalInfoCR Updates a SnatGlobalInfo CR

func UpdateSnatPolicyCR

func UpdateSnatPolicyCR(c snatpolicyclset.Clientset, policy *snatpolicy.SnatPolicy) error

UpdateSnatPolicy Updates a UpdateSnatPolicy CR

Types

type EncapMode

type EncapMode int
const (
	EncapModeTrunk    EncapMode = 0
	EncapModeNative   EncapMode = 1
	EncapModeUntagged EncapMode = 2
)

func ToEncapMode

func ToEncapMode(encapModeString fabattv1.EncapMode) EncapMode

func (EncapMode) String

func (e EncapMode) String() string

func (EncapMode) ToFabAttEncapMode

func (e EncapMode) ToFabAttEncapMode() fabattv1.EncapMode

type StartSorter

type StartSorter []snatglobal.PortRange

func (StartSorter) Len

func (a StartSorter) Len() int

func (StartSorter) Less

func (a StartSorter) Less(i, j int) bool

func (StartSorter) Swap

func (a StartSorter) Swap(i, j int)

Jump to

Keyboard shortcuts

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