Documentation ¶
Index ¶
- Constants
- func AddIPAddress(vmi *v1.VirtualMachineInstance, interfaceName, interfaceAddress string) error
- func AddLabelToNamespace(client kubecli.KubevirtClient, namespace, key, value string) error
- func CheckMacAddress(vmi *v1.VirtualMachineInstance, interfaceName, macAddress string) error
- func CidrToIP(cidr string) (string, error)
- func CreateNAD(namespace, nadName string) errordeprecated
- func CreateNetAttachDef(ctx context.Context, namespace string, ...) (*nadv1.NetworkAttachmentDefinition, error)
- func FormatIPForURL(ip string) string
- func GenerateRandomMac() (net.HardwareAddr, error)
- func GetIP(ips []string, family k8sv1.IPFamily) string
- func GetLoopbackAddress(family k8sv1.IPFamily) string
- func GetLoopbackAddressForURL(family k8sv1.IPFamily) string
- func GetPodIPByFamily(pod *k8sv1.Pod, family k8sv1.IPFamily) string
- func GetVmiPrimaryIPByFamily(vmi *v1.VirtualMachineInstance, family k8sv1.IPFamily) string
- func InterfaceExists(vmi *v1.VirtualMachineInstance, interfaceName string) error
- func LookupNetworkByName(networks []v1.Network, name string) *v1.Network
- func NewBridgeNetAttachDef(name, bridgeName string, opts ...pluginConfOption) *nadv1.NetworkAttachmentDefinition
- func NewMacvtapNetAttachDef(name, lowerDevice string) *nadv1.NetworkAttachmentDefinition
- func NewNetAttachDef(name, config string) *nadv1.NetworkAttachmentDefinition
- func NewNetConfig(name string, pluginsConfigs ...map[string]interface{}) string
- func NewNetPluginConfig(cniType string, conf map[string]interface{}) map[string]interface{}
- func NewPasstNetAttachDef(name string) *nadv1.NetworkAttachmentDefinition
- func NewSriovNetAttachDef(name string, vlanID int, opts ...pluginConfOption) *nadv1.NetworkAttachmentDefinition
- func PatchNamespace(client kubecli.KubevirtClient, namespace string, patchFunc func(*v1.Namespace)) error
- func PatchVMWithNewInterface(vm *v1.VirtualMachine, newNetwork v1.Network, newIface v1.Interface) error
- func PingFromVMConsole(vmi *v1.VirtualMachineInstance, ipAddr string, args ...string) error
- func RemoveLabelFromNamespace(client kubecli.KubevirtClient, namespace, key string) error
- func SetInterfaceUp(vmi *v1.VirtualMachineInstance, interfaceName string) error
- func SkipWhenClusterNotSupportIPFamily(ipFamily k8sv1.IPFamily)
- func SkipWhenClusterNotSupportIpv4()
- func SkipWhenClusterNotSupportIpv6()
- func ValidateVMIandPodIPMatch(vmi *v1.VirtualMachineInstance, vmiPod *k8sv1.Pod) error
- func VerifyDynamicInterfaceChange(vmi *v1.VirtualMachineInstance, queueCount int32) *v1.VirtualMachineInstance
- func WaitForSingleHotPlugIfaceOnVMISpec(vmi *v1.VirtualMachineInstance, ifaceName, nadName string) *v1.VirtualMachineInstance
- func WithIPAM(ipam map[string]string) pluginConfOption
- func WithLinkState() pluginConfOption
- func WithMTU(mtu int) pluginConfOption
- func WithMacSpoofChk(enabled bool) pluginConfOption
- func WithMasqueradeNetworking(ports ...v1.Port) libvmi.Option
- func WithVLAN(vlanID int) pluginConfOption
Constants ¶
View Source
const ( // ResourceNameAnnotation represents a resource name that is associated with the network. // It could be found on NetworkAttachmentDefinition objects. ResourceNameAnnotation = "k8s.v1.cni.cncf.io/resourceName" )
Variables ¶
This section is empty.
Functions ¶
func AddIPAddress ¶ added in v1.2.0
func AddIPAddress(vmi *v1.VirtualMachineInstance, interfaceName, interfaceAddress string) error
func AddLabelToNamespace ¶ added in v0.42.0
func AddLabelToNamespace(client kubecli.KubevirtClient, namespace, key, value string) error
func CheckMacAddress ¶ added in v1.4.0
func CheckMacAddress(vmi *v1.VirtualMachineInstance, interfaceName, macAddress string) error
func CreateNetAttachDef ¶
func CreateNetAttachDef( ctx context.Context, namespace string, netAttachDef *nadv1.NetworkAttachmentDefinition, ) (*nadv1.NetworkAttachmentDefinition, error)
func FormatIPForURL ¶ added in v1.1.0
func GenerateRandomMac ¶ added in v1.3.0
func GenerateRandomMac() (net.HardwareAddr, error)
func GetLoopbackAddress ¶ added in v0.52.0
func GetLoopbackAddressForURL ¶ added in v0.55.0
func GetPodIPByFamily ¶ added in v0.55.0
func GetVmiPrimaryIPByFamily ¶ added in v0.55.0
func GetVmiPrimaryIPByFamily(vmi *v1.VirtualMachineInstance, family k8sv1.IPFamily) string
func InterfaceExists ¶ added in v1.0.0
func InterfaceExists(vmi *v1.VirtualMachineInstance, interfaceName string) error
func LookupNetworkByName ¶ added in v1.0.1
func NewBridgeNetAttachDef ¶
func NewBridgeNetAttachDef(name, bridgeName string, opts ...pluginConfOption) *nadv1.NetworkAttachmentDefinition
func NewMacvtapNetAttachDef ¶
func NewMacvtapNetAttachDef(name, lowerDevice string) *nadv1.NetworkAttachmentDefinition
func NewNetAttachDef ¶
func NewNetAttachDef(name, config string) *nadv1.NetworkAttachmentDefinition
func NewNetConfig ¶
func NewNetPluginConfig ¶
func NewPasstNetAttachDef ¶
func NewPasstNetAttachDef(name string) *nadv1.NetworkAttachmentDefinition
func NewSriovNetAttachDef ¶
func NewSriovNetAttachDef(name string, vlanID int, opts ...pluginConfOption) *nadv1.NetworkAttachmentDefinition
func PatchNamespace ¶ added in v0.58.1
func PatchVMWithNewInterface ¶ added in v1.3.0
func PingFromVMConsole ¶ added in v0.35.0
func PingFromVMConsole(vmi *v1.VirtualMachineInstance, ipAddr string, args ...string) error
PingFromVMConsole performs a ping through the provided VMI console. Optional arguments for the ping command may be provided, overwirting the default ones. (default ping options: "-c 5, -w 10") Note: The maximum overall command timeout is 20 seconds.
func RemoveLabelFromNamespace ¶ added in v0.42.0
func RemoveLabelFromNamespace(client kubecli.KubevirtClient, namespace, key string) error
func SetInterfaceUp ¶ added in v1.2.0
func SetInterfaceUp(vmi *v1.VirtualMachineInstance, interfaceName string) error
func SkipWhenClusterNotSupportIPFamily ¶ added in v0.55.0
func SkipWhenClusterNotSupportIpv4 ¶ added in v0.52.0
func SkipWhenClusterNotSupportIpv4()
func SkipWhenClusterNotSupportIpv6 ¶ added in v0.52.0
func SkipWhenClusterNotSupportIpv6()
func ValidateVMIandPodIPMatch ¶ added in v0.35.0
func ValidateVMIandPodIPMatch(vmi *v1.VirtualMachineInstance, vmiPod *k8sv1.Pod) error
ValidateVMIandPodIPMatch Checks that the vmi pod and vmi scheme have matching Ip/Ips fields for primary interface
func VerifyDynamicInterfaceChange ¶ added in v1.3.0
func VerifyDynamicInterfaceChange(vmi *v1.VirtualMachineInstance, queueCount int32) *v1.VirtualMachineInstance
func WaitForSingleHotPlugIfaceOnVMISpec ¶ added in v1.3.0
func WaitForSingleHotPlugIfaceOnVMISpec(vmi *v1.VirtualMachineInstance, ifaceName, nadName string) *v1.VirtualMachineInstance
func WithLinkState ¶
func WithLinkState() pluginConfOption
func WithMacSpoofChk ¶
func WithMacSpoofChk(enabled bool) pluginConfOption
func WithMasqueradeNetworking ¶ added in v1.3.0
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.