Documentation ¶
Index ¶
- func CleanDeviceInfoForCNI(cniPath string) error
- func CleanDeviceInfoForDP(resourceName string, deviceID string) error
- func CopyDeviceInfoForCNIFromDP(cniPath string, resourceName string, deviceID string) error
- func CreateNetworkStatus(r cnitypes.Result, networkName string, defaultNetwork bool, dev *v1.DeviceInfo) (*v1.NetworkStatus, error)
- func CreateNetworkStatuses(r cnitypes.Result, networkName string, defaultNetwork bool, dev *v1.DeviceInfo) ([]*v1.NetworkStatus, error)
- func GetCNIConfig(net *v1.NetworkAttachmentDefinition, confDir string) (config []byte, err error)
- func GetCNIConfigFromFile(name, confDir string) ([]byte, error)
- func GetCNIConfigFromSpec(configData, netName string) ([]byte, error)
- func GetCNIDeviceInfoPath(filename string) string
- func GetNetworkStatus(pod *corev1.Pod) ([]v1.NetworkStatus, error)
- func LoadDeviceInfoFromCNI(cniPath string) (*v1.DeviceInfo, error)
- func LoadDeviceInfoFromDP(resourceName string, deviceID string) (*v1.DeviceInfo, error)
- func ParseNetworkAnnotation(podNetworks, defaultNamespace string) ([]*v1.NetworkSelectionElement, error)
- func ParsePodNetworkAnnotation(pod *corev1.Pod) ([]*v1.NetworkSelectionElement, error)
- func SaveDeviceInfoForCNI(cniPath string, devInfo *v1.DeviceInfo) error
- func SaveDeviceInfoForDP(resourceName string, deviceID string, devInfo *v1.DeviceInfo) error
- func SetNetworkStatus(client kubernetes.Interface, pod *corev1.Pod, statuses []v1.NetworkStatus) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanDeviceInfoForCNI ¶ added in v1.2.0
CleanDeviceInfoForCNI removes a DeviceInfo CNI File.
func CleanDeviceInfoForDP ¶ added in v1.2.0
CleanDeviceInfoForDP removes a DeviceInfo DP File.
func CopyDeviceInfoForCNIFromDP ¶ added in v1.2.0
CopyDeviceInfoForCNIFromDP saves a DeviceInfo structure created by a DP to a CNI File.
func CreateNetworkStatus ¶
func CreateNetworkStatus(r cnitypes.Result, networkName string, defaultNetwork bool, dev *v1.DeviceInfo) (*v1.NetworkStatus, error)
CreateNetworkStatus create NetworkStatus from CNI result
func CreateNetworkStatuses ¶ added in v1.7.1
func CreateNetworkStatuses(r cnitypes.Result, networkName string, defaultNetwork bool, dev *v1.DeviceInfo) ([]*v1.NetworkStatus, error)
CreateNetworkStatuses creates an array of NetworkStatus from CNI result Not to be confused with CreateNetworkStatus (singular) This is the preferred method and picks up when CNI ADD results contain multiple container interfaces
func GetCNIConfig ¶
func GetCNIConfig(net *v1.NetworkAttachmentDefinition, confDir string) (config []byte, err error)
GetCNIConfig (from annotation string to CNI JSON bytes)
func GetCNIConfigFromFile ¶
GetCNIConfigFromSpec reads a CNI JSON configuration from given directory (confDir)
func GetCNIConfigFromSpec ¶
GetCNIConfigFromSpec reads a CNI JSON configuration from the NetworkAttachmentDefinition object's Spec.Config field and fills in any missing details like the network name
func GetCNIDeviceInfoPath ¶ added in v1.2.0
GetCNIDeviceInfoPath returns the standard Device Plugin DevInfo filename The path is fixed but the filename is flexible and determined by the caller.
func GetNetworkStatus ¶
func GetNetworkStatus(pod *corev1.Pod) ([]v1.NetworkStatus, error)
GetNetworkStatus returns pod's network status
func LoadDeviceInfoFromCNI ¶ added in v1.2.0
func LoadDeviceInfoFromCNI(cniPath string) (*v1.DeviceInfo, error)
LoadDeviceInfoFromCNI loads a DeviceInfo structure from created by a CNI. Returns an error if the device information is malformed and (nil, nil) if it does not exist
func LoadDeviceInfoFromDP ¶ added in v1.2.0
func LoadDeviceInfoFromDP(resourceName string, deviceID string) (*v1.DeviceInfo, error)
LoadDeviceInfoFromDP loads a DeviceInfo structure from file created by a Device Plugin Returns an error if the device information is malformed and (nil, nil) if it does not exist
func ParseNetworkAnnotation ¶
func ParseNetworkAnnotation(podNetworks, defaultNamespace string) ([]*v1.NetworkSelectionElement, error)
ParseNetworkAnnotation parses actual annotation string and get NetworkSelectionElement
func ParsePodNetworkAnnotation ¶
func ParsePodNetworkAnnotation(pod *corev1.Pod) ([]*v1.NetworkSelectionElement, error)
ParsePodNetworkAnnotation parses Pod annotation for net-attach-def and get NetworkSelectionElement
func SaveDeviceInfoForCNI ¶ added in v1.2.0
func SaveDeviceInfoForCNI(cniPath string, devInfo *v1.DeviceInfo) error
SaveDeviceInfoForCNI saves a DeviceInfo structure created by a CNI
func SaveDeviceInfoForDP ¶ added in v1.2.0
func SaveDeviceInfoForDP(resourceName string, deviceID string, devInfo *v1.DeviceInfo) error
SaveDeviceInfoForDP saves a DeviceInfo structure created by a Device Plugin
func SetNetworkStatus ¶
func SetNetworkStatus(client kubernetes.Interface, pod *corev1.Pod, statuses []v1.NetworkStatus) error
SetNetworkStatus updates the Pod status
Types ¶
This section is empty.