namescheme

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HashedIfacePrefix = "pod"

	PrimaryPodInterfaceName = "eth0"
)

Variables

This section is empty.

Functions

func CreateHashedNetworkNameScheme added in v1.0.0

func CreateHashedNetworkNameScheme(vmiNetworks []v1.Network) map[string]string

CreateHashedNetworkNameScheme iterates over the VMI's Networks, and creates for each a pod interface name. The returned map associates between the network name and the generated pod interface name. Primary network will use "eth0" and the secondary ones will be named with the hashed network name.

func CreateNetworkNameSchemeByPodNetworkStatus added in v1.0.0

func CreateNetworkNameSchemeByPodNetworkStatus(networks []v1.Network, networkStatus map[string]networkv1.NetworkStatus) map[string]string

CreateNetworkNameSchemeByPodNetworkStatus create pod network name scheme according to the given VMI spec networks and pod network status. In case the pod network status has at least one interface with ordinal interface name it returns the ordinal network name-scheme, Otherwise, returns the hashed network name scheme.

func CreateOrdinalNetworkNameScheme added in v1.0.0

func CreateOrdinalNetworkNameScheme(vmiNetworks []v1.Network) map[string]string

CreateOrdinalNetworkNameScheme iterates over the VMI's Networks, and creates for each a pod interface name. The returned map associates between the network name and the generated pod interface name. Primary network will use "eth0" and the secondary ones will use "net<id>" format, where id is an enumeration from 1 to n.

func GenerateHashedInterfaceName added in v1.0.0

func GenerateHashedInterfaceName(networkName string) string

func HashedPodInterfaceName added in v1.0.0

func HashedPodInterfaceName(network v1.Network) string

func OrdinalPodInterfaceName added in v1.0.0

func OrdinalPodInterfaceName(name string, networks []v1.Network) string

func OrdinalSecondaryInterfaceName added in v1.0.0

func OrdinalSecondaryInterfaceName(name string) bool

OrdinalSecondaryInterfaceName check if the given name is in form of the ordinal name scheme (e.g.: net1, net2..). Primary iface name (eth0) is treated as non-ordinal interface name.

func PodHasOrdinalInterfaceName added in v1.0.0

func PodHasOrdinalInterfaceName(podNetworkStatus map[string]networkv1.NetworkStatus) bool

PodHasOrdinalInterfaceName check if the given pod network status has at least one pod interface with ordinal name

Types

This section is empty.

Jump to

Keyboard shortcuts

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