Documentation ¶
Index ¶
- func GetDefaultNetworks(k8sArgs *types.K8sArgs, conf *types.NetConf, kubeClient KubeClient) error
- func GetK8sArgs(args *skel.CmdArgs) (*types.K8sArgs, error)
- func GetNetworkDelegates(k8sclient KubeClient, pod *v1.Pod, networks []*types.NetworkSelectionElement, ...) ([]*types.DelegateNetConf, error)
- func GetPodNetwork(pod *v1.Pod) ([]*types.NetworkSelectionElement, error)
- func SetNetworkStatus(client KubeClient, k8sArgs *types.K8sArgs, netStatus []*types.NetworkStatus, ...) error
- type ClientInfo
- type KubeClient
- type NoK8sNetworkError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultNetworks ¶
GetDefaultNetworks parses 'defaultNetwork' config, gets network json and put it into netconf.Delegates.
func GetK8sArgs ¶
GetK8sArgs gets k8s related args from CNI args
func GetNetworkDelegates ¶
func GetNetworkDelegates(k8sclient KubeClient, pod *v1.Pod, networks []*types.NetworkSelectionElement, confdir string, confnamespaceIsolation bool) ([]*types.DelegateNetConf, error)
GetNetworkDelegates returns delegatenetconf from net-attach-def annotation in pod
func GetPodNetwork ¶
func GetPodNetwork(pod *v1.Pod) ([]*types.NetworkSelectionElement, error)
GetPodNetwork gets net-attach-def annotation from pod
func SetNetworkStatus ¶
func SetNetworkStatus(client KubeClient, k8sArgs *types.K8sArgs, netStatus []*types.NetworkStatus, conf *types.NetConf) error
SetNetworkStatus sets network status into Pod annotation
Types ¶
type ClientInfo ¶
type ClientInfo struct { Client KubeClient Podnamespace string Podname string }
ClientInfo contains information given from k8s client
func TryLoadPodDelegates ¶
func TryLoadPodDelegates(k8sArgs *types.K8sArgs, conf *types.NetConf, kubeClient KubeClient) (int, *ClientInfo, error)
TryLoadPodDelegates attempts to load Kubernetes-defined delegates and add them to the Multus config. Returns the number of Kubernetes-defined delegates added or an error.
type KubeClient ¶
type KubeClient interface { GetRawWithPath(path string) ([]byte, error) GetPod(namespace, name string) (*v1.Pod, error) UpdatePodStatus(pod *v1.Pod) (*v1.Pod, error) }
KubeClient is abstraction layer for k8s client (used testing package)
func GetK8sClient ¶
func GetK8sClient(kubeconfig string, kubeClient KubeClient) (KubeClient, error)
GetK8sClient gets client info from kubeconfig
type NoK8sNetworkError ¶
type NoK8sNetworkError struct {
// contains filtered or unexported fields
}
NoK8sNetworkError indicates error, no network in kubernetes
func (*NoK8sNetworkError) Error ¶
func (e *NoK8sNetworkError) Error() string