Documentation
¶
Index ¶
Constants ¶
const ( // NormalizedPrefix is added to device names that had to be encoded // because their original interface name was not DNS-1123 compliant. NormalizedPrefix = "normalized-" )
Variables ¶
This section is empty.
Functions ¶
func GetOriginalName ¶
GetOriginalName retrieves the original interface name from a deviceName. If deviceName was prefixed with NormalizedPrefix (indicating it was encoded), it decodes the name. Otherwise, it assumes deviceName is the original name.
func SetDeviceName ¶
SetDeviceName determines the appropriate name for a device 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.
Types ¶
This section is empty.