libnet

package
v0.47.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultIPv6Address = "fd10:0:2::2"
	DefaultIPv6CIDR    = DefaultIPv6Address + "/120"
	DefaultIPv6Gateway = "fd10:0:2::1"
)

Variables

This section is empty.

Functions

func AddLabelToNamespace added in v0.42.0

func AddLabelToNamespace(client kubecli.KubevirtClient, namespace, key, value string) error

func ClusterDNSServiceIP added in v0.35.0

func ClusterDNSServiceIP() (string, error)

ClusterDNSServiceIP returns the cluster IP address of the DNS service. Attempts first to detect the DNS service on a k8s cluster and if not found on an openshift cluster.

func CreateDefaultCloudInitNetworkData added in v0.35.0

func CreateDefaultCloudInitNetworkData() (string, error)

CreateDefaultCloudInitNetworkData generates a default configuration for the Cloud-Init Network Data, in version 2 format. The default configuration sets dynamic IPv4 (DHCP) and static IPv6 addresses, inclusing DNS settings of the cluster nameserver IP and search domains.

func GetIp added in v0.35.0

func GetIp(ips []string, family k8sv1.IPFamily) string

func GetPodIpByFamily added in v0.35.0

func GetPodIpByFamily(pod *k8sv1.Pod, family k8sv1.IPFamily) string

func GetVmiPrimaryIpByFamily added in v0.34.1

func GetVmiPrimaryIpByFamily(vmi *v1.VirtualMachineInstance, family k8sv1.IPFamily) string

func IsClusterDualStack

func IsClusterDualStack(virtClient kubecli.KubevirtClient) (bool, error)

func NewExposeArgs added in v0.45.0

func NewExposeArgs(resource, namespace, name string, opts ...Option) []string

func NewNetworkData added in v0.36.0

func NewNetworkData(options ...NetworkDataOption) (string, error)

func NewVMExposeArgs added in v0.45.0

func NewVMExposeArgs(vm *v1.VirtualMachine, opts ...Option) []string

func NewVMIExposeArgs added in v0.45.0

func NewVMIExposeArgs(vmi *v1.VirtualMachineInstance, opts ...Option) []string

func NewVMIRSExposeArgs added in v0.45.0

func NewVMIRSExposeArgs(vmrs *v1.VirtualMachineInstanceReplicaSet, opts ...Option) []string

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 RemoveAllLabelsFromNamespace added in v0.42.0

func RemoveAllLabelsFromNamespace(client kubecli.KubevirtClient, namespace string) error

func RemoveLabelFromNamespace added in v0.42.0

func RemoveLabelFromNamespace(client kubecli.KubevirtClient, namespace, key string) error

func SearchDomains added in v0.35.0

func SearchDomains() []string

SearchDomains returns a list of default search name domains.

func SkipWhenNotDualStackCluster added in v0.34.1

func SkipWhenNotDualStackCluster(virtClient kubecli.KubevirtClient)

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 WithIPv6 added in v0.36.0

func WithIPv6(loginToFactory console.LoginToFactory) console.LoginToFactory

func WithPort added in v0.45.0

func WithPort(port string) func(cmdArgs []string) []string

func WithProtocol added in v0.45.0

func WithProtocol(protocol string) func(cmdArgs []string) []string

func WithServiceName added in v0.45.0

func WithServiceName(serviceName string) func(cmdArgs []string) []string

func WithTargetPort added in v0.45.0

func WithTargetPort(targetPort string) func(cmdArgs []string) []string

func WithType added in v0.45.0

func WithType(serviceType string) func(cmdArgs []string) []string

Types

type CloudInitInterface added in v0.35.0

type CloudInitInterface struct {
	AcceptRA       *bool                `json:"accept-ra,omitempty"`
	Addresses      []string             `json:"addresses,omitempty"`
	DHCP4          *bool                `json:"dhcp4,omitempty"`
	DHCP6          *bool                `json:"dhcp6,omitempty"`
	DHCPIdentifier string               `json:"dhcp-identifier,omitempty"` // "duid" or  "mac"
	Gateway4       string               `json:"gateway4,omitempty"`
	Gateway6       string               `json:"gateway6,omitempty"`
	Nameservers    CloudInitNameservers `json:"nameservers,omitempty"`
	MACAddress     string               `json:"macaddress,omitempty"`
	Match          CloudInitMatch       `json:"match,omitempty"`
	MTU            int                  `json:"mtu,omitempty"`
	Routes         []CloudInitRoute     `json:"routes,omitempty"`
	SetName        string               `json:"set-name,omitempty"`
	// contains filtered or unexported fields
}

type CloudInitMatch added in v0.36.0

type CloudInitMatch struct {
	Name       string `json:"name,omitempty"`
	MACAddress string `json:"macaddress,omitempty"`
	Driver     string `json:"driver,omitempty"`
}

type CloudInitNameservers added in v0.35.0

type CloudInitNameservers struct {
	Search    []string `json:"search,omitempty,flow"`
	Addresses []string `json:"addresses,omitempty,flow"`
}

type CloudInitNetworkData added in v0.35.0

type CloudInitNetworkData struct {
	Version   int                           `json:"version"`
	Ethernets map[string]CloudInitInterface `json:"ethernets,omitempty"`
}

type CloudInitRoute added in v0.35.0

type CloudInitRoute struct {
	From   string `json:"from,omitempty"`
	OnLink *bool  `json:"on-link,omitempty"`
	Scope  string `json:"scope,omitempty"`
	Table  *int   `json:"table,omitempty"`
	To     string `json:"to,omitempty"`
	Type   string `json:"type,omitempty"`
	Via    string `json:"via,omitempty"`
	Metric *int   `json:"metric,omitempty"`
}

type NetworkDataInterfaceOption added in v0.36.0

type NetworkDataInterfaceOption func(*CloudInitInterface) error

func WithAcceptRA added in v0.37.0

func WithAcceptRA() NetworkDataInterfaceOption

func WithAddresses added in v0.36.0

func WithAddresses(addresses ...string) NetworkDataInterfaceOption

func WithDHCP4Enabled added in v0.36.0

func WithDHCP4Enabled() NetworkDataInterfaceOption

func WithDHCP6Enabled added in v0.37.0

func WithDHCP6Enabled() NetworkDataInterfaceOption

func WithGateway6 added in v0.36.0

func WithGateway6(gateway6 string) NetworkDataInterfaceOption

func WithMatchingMAC added in v0.36.0

func WithMatchingMAC(macAddress string) NetworkDataInterfaceOption

func WithNameserverFromCluster added in v0.36.0

func WithNameserverFromCluster() NetworkDataInterfaceOption

type NetworkDataOption added in v0.36.0

type NetworkDataOption func(*CloudInitNetworkData) error

func WithEthernet added in v0.36.0

func WithEthernet(name string, options ...NetworkDataInterfaceOption) NetworkDataOption

type Option added in v0.45.0

type Option func(cmdArgs []string) []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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