networkattachment

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNetworksAnnotation

func CreateNetworksAnnotation(namespace string, nads []string) (map[string]string, error)

CreateNetworksAnnotation returns pod annotation for network-attachment-definition list e.g. k8s.v1.cni.cncf.io/networks: '[{"name": "internalapi", "namespace": "openstack"},{"name": "storage", "namespace": "openstack"}]'

func GetNADWithName

func GetNADWithName(
	ctx context.Context,
	h *helper.Helper,
	name string,
	namespace string,
) (*networkv1.NetworkAttachmentDefinition, error)

GetNADWithName - Get network-attachment-definition with name in namespace

func GetNetworkIFName

func GetNetworkIFName(nad string) string

GetNetworkIFName returns the interface name base on the NAD name the interface name in Linux must not be longer then 15 chars.

func GetNetworkStatusFromAnnotation

func GetNetworkStatusFromAnnotation(annotations map[string]string) ([]networkv1.NetworkStatus, error)

GetNetworkStatusFromAnnotation returns NetworkStatus list with networking details the pods are attached to

func VerifyNetworkStatusFromAnnotation

func VerifyNetworkStatusFromAnnotation(
	ctx context.Context,
	helper *helper.Helper,
	networkAttachments []string,
	serviceLabels map[string]string,
	readyCount int32,
) (bool, map[string][]string, error)

VerifyNetworkStatusFromAnnotation - verifies if NetworkStatus annotation for the pods of a deployment, pods identified via the service label selector, matches the passed in network attachments and the number of per network IPs the ready count of the deployment. Return true if count matches with the list of IPs per network.

Types

This section is empty.

Jump to

Keyboard shortcuts

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