ocicni

package
v0.0.0-...-7ef7dd6 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CniManager

type CniManager struct {
	// contains filtered or unexported fields
}

CniManager is an implementation of interface CniMgr.

func (*CniManager) GetPodNetworkStatus

func (c *CniManager) GetPodNetworkStatus(netnsPath string) (string, error)

GetPodNetworkStatus is the method called to obtain the ipv4 or ipv6 addresses of the pod sandbox.

func (*CniManager) Name

func (c *CniManager) Name() string

Name returns the plugin's name. This will be used when searching for a plugin by name, e.g.

func (*CniManager) SetUpPodNetwork

func (c *CniManager) SetUpPodNetwork(podNetwork *ocicni.PodNetwork) error

SetUpPodNetwork is the method called after the sandbox container of the pod has been created but before the other containers of the pod are launched.

func (*CniManager) Status

func (c *CniManager) Status() error

Status returns error if the network plugin is in error state.

func (*CniManager) TearDownPodNetwork

func (c *CniManager) TearDownPodNetwork(podNetwork *ocicni.PodNetwork) error

TearDownPodNetwork is the method called before a pod's sandbox container will be deleted.

type CniMgr

type CniMgr interface {
	// Name returns the plugin's name. This will be used when searching
	// for a plugin by name, e.g.
	Name() string

	// SetUpPodNetwork is the method called after the sandbox container of the
	// pod has been created but before the other containers of the pod
	// are launched.
	SetUpPodNetwork(podNetwork *ocicni.PodNetwork) error

	// TearDownPodNetwork is the method called before a pod's sandbox container will be deleted.
	TearDownPodNetwork(podNetwork *ocicni.PodNetwork) error

	// GetPodNetworkStatus is the method called to obtain the ipv4 or ipv6 addresses of the pod sandbox.
	GetPodNetworkStatus(netnsPath string) (string, error)

	// Status returns error if the network plugin is in error state.
	Status() error
}

CniMgr as an interface defines all operations against CNI.

func NewCniManager

func NewCniManager(cfg *config.Config) (CniMgr, error)

NewCniManager initializes a brand new cni manager. If initialize failed, return NoopCniManager, we should not make pouchd creashed because of the failure of cni manager.

Jump to

Keyboard shortcuts

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