utils

package
v0.3.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	KeyVlanLabel = network.GroupName + "/vlan-id"
	// KeyLastVlanLabel is used to record the last VLAN id to support changing the VLAN id of the VLAN networks
	KeyLastVlanLabel       = network.GroupName + "/last-vlan-id"
	KeyVlanConfigLabel     = network.GroupName + "/vlanconfig"
	KeyClusterNetworkLabel = network.GroupName + "/clusternetwork"
	// KeyLastClusterNetworkLabel is used to record the last cluster network to support changing the cluster network of NADs
	KeyLastClusterNetworkLabel = network.GroupName + "/last-clusternetwork"
	KeyNodeLabel               = network.GroupName + "/node"
	KeyNetworkType             = network.GroupName + "/type"
	KeyLastNetworkType         = network.GroupName + "/last-type"
	KeyNetworkReady            = network.GroupName + "/ready"
	KeyNetworkRoute            = network.GroupName + "/route"

	KeyMatchedNodes = network.GroupName + "/matched-nodes"

	ValueTrue  = "true"
	ValueFalse = "false"
)
View Source
const ManagementClusterNetworkName = "mgmt"

Variables

This section is empty.

Functions

func EnsureSysctlValue

func EnsureSysctlValue(name, value string) error

func IsVlanNad

func IsVlanNad(nad *nadv1.NetworkAttachmentDefinition) bool

func Name

func Name(prefix string, s ...string) string

Name function joints prefix with all other strings and crc32 checksum

func NewSelector

func NewSelector(selector map[string]string) (labels.Selector, error)

Types

type Connectivity

type Connectivity string
const (
	Connectable   Connectivity = "true"
	Unconnectable Connectivity = "false"
	DHCPFailed    Connectivity = "DHCP failed"
	PingFailed    Connectivity = "ping failed"
)

type Layer3NetworkConf

type Layer3NetworkConf struct {
	Mode         Mode         `json:"mode,omitempty"`
	CIDR         string       `json:"cidr,omitempty"`
	Gateway      string       `json:"gateway,omitempty"`
	ServerIPAddr string       `json:"serverIPAddr,omitempty"`
	Connectivity Connectivity `json:"connectivity,omitempty"`
	Outdated     bool         `json:"outdated,omitempty"`
}

func NewLayer3NetworkConf

func NewLayer3NetworkConf(conf string) (*Layer3NetworkConf, error)

func (*Layer3NetworkConf) ToString

func (c *Layer3NetworkConf) ToString() (string, error)

type Mode

type Mode string
const (
	Auto   Mode = "auto"
	Manual Mode = "manual"
)

type NadSelectedNetworks

type NadSelectedNetworks []nadv1.NetworkSelectionElement

func NewNADSelectedNetworks

func NewNADSelectedNetworks(conf string) (NadSelectedNetworks, error)

func (NadSelectedNetworks) ToString

func (n NadSelectedNetworks) ToString() (string, error)

type NetConf

type NetConf struct {
	cniv1.NetConf
	BrName       string `json:"bridge"`
	IsGW         bool   `json:"isGateway"`
	IsDefaultGW  bool   `json:"isDefaultGateway"`
	ForceAddress bool   `json:"forceAddress"`
	IPMasq       bool   `json:"ipMasq"`
	MTU          int    `json:"mtu"`
	HairpinMode  bool   `json:"hairpinMode"`
	PromiscMode  bool   `json:"promiscMode"`
	Vlan         int    `json:"vlan"`
}

type NetworkType

type NetworkType string
const (
	L2VlanNetwork   NetworkType = "L2VlanNetwork"
	UntaggedNetwork NetworkType = "UntaggedNetwork"
)

type VmiGetter

type VmiGetter struct {
	VmiCache ctlkubevirtv1.VirtualMachineInstanceCache
}

func (*VmiGetter) WhoUseNad

WhoUseNad requires adding network indexer to the vmi cache before invoking it

Jump to

Keyboard shortcuts

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