names

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NormalizedInterfacePrefix is prefix used when normalizing a network
	// interface.
	NormalizedInterfacePrefix = "net"
	// NormalizedPCIPrefix is the prefix used when normalizing a PCI Address.
	NormalizedPCIPrefix = "pci"
)

Variables

This section is empty.

Functions

func NormalizeInterfaceName added in v0.7.0

func NormalizeInterfaceName(ifName string) string

NormalizeInterfaceName determines the appropriate name for an interface in Kubernetes. If the original interface name (ifName) is already a valid DNS-1123 label, it's returned as is. Otherwise, it's encoded using Base32, prefixed with NormalizedPrefix, and returned.

Linux interface names (often limited by IFNAMSIZ, typically 16) plus the base32 encoding and the normalized prefix (11) are within the DNS-1123 label, which has a maximum length of 63.

func NormalizePCIAddress added in v0.7.0

func NormalizePCIAddress(pciAddress string) string

NormalizePCIAddress takes a PCI address and converts it into a DNS-1123 acceptable format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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