-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
29 lines (23 loc) · 1.03 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package ocicni
const (
DefaultInterfaceName = "eth0"
CNIPluginName = "cni"
DefaultNetDir = "/etc/cni/net.d"
DefaultCNIDir = "/opt/cni/bin"
VendorCNIDirTemplate = "%s/opt/%s/bin"
)
type CNIPlugin interface {
// Name returns the plugin's name. This will be used when searching
// for a plugin by name, e.g.
Name() string
// SetUpPod is the method called after the infra container of
// the pod has been created but before the other containers of the
// pod are launched.
SetUpPod(netnsPath string, namespace string, name string, containerID string) error
// TearDownPod is the method called before a pod's infra container will be deleted
TearDownPod(netnsPath string, namespace string, name string, containerID string) error
// Status is the method called to obtain the ipv4 or ipv6 addresses of the container
GetContainerNetworkStatus(netnsPath string, namespace string, name string, containerID string) (string, error)
// NetworkStatus returns error if the network plugin is in error state
Status() error
}