k8sclient

package
v0.0.0-...-59ec6f1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultNetworks

func GetDefaultNetworks(k8sArgs *types.K8sArgs, conf *types.NetConf, kubeClient KubeClient) error

GetDefaultNetwork parses 'defaultNetwork' config, gets network json and put it into netconf.Delegates.

func GetK8sArgs

func GetK8sArgs(args *skel.CmdArgs) (*types.K8sArgs, error)

func GetNetworkDelegates

func GetNetworkDelegates(k8sclient KubeClient, pod *v1.Pod, networks []*types.NetworkSelectionElement, confdir string, confnamespaceIsolation bool) ([]*types.DelegateNetConf, error)

func GetPodNetwork

func GetPodNetwork(pod *v1.Pod) ([]*types.NetworkSelectionElement, error)

func SetNetworkStatus

func SetNetworkStatus(client KubeClient, k8sArgs *types.K8sArgs, netStatus []*types.NetworkStatus, conf *types.NetConf) error

func TryLoadPodDelegates

func TryLoadPodDelegates(k8sArgs *types.K8sArgs, conf *types.NetConf, kubeClient KubeClient) (int, *clientInfo, error)

Attempts to load Kubernetes-defined delegates and add them to the Multus config. Returns the number of Kubernetes-defined delegates added or an error.

Types

type KubeClient

type KubeClient interface {
	GetRawWithPath(path string) ([]byte, error)
	GetPod(namespace, name string) (*v1.Pod, error)
	UpdatePodStatus(pod *v1.Pod) (*v1.Pod, error)
}

func GetK8sClient

func GetK8sClient(kubeconfig string, kubeClient KubeClient) (KubeClient, error)

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

Jump to

Keyboard shortcuts

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