cni

package
v0.57.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 33 Imported by: 2

README

This package abstracts CNI from libpod. It implements the ContainerNetwork interface defined in libpod/network/types/network.go for the CNI backend.

Testing

Run the tests with:

go test -v -mod=vendor -cover ./libpod/network/cni/

Run the tests as root to also test setup/teardown. This will execute CNI and therefore the cni plugins have to be installed.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CNIResultToStatus

func CNIResultToStatus(res cnitypes.Result) (types.StatusBlock, error)

CNIResultToStatus convert the cni result to status block nolint:golint,revive

func NewCNINetworkInterface

func NewCNINetworkInterface(conf *InitConfig) (types.ContainerNetwork, error)

NewCNINetworkInterface creates the ContainerNetwork interface for the CNI backend. Note: The networks are not loaded from disk until a method is called.

Types

type InitConfig

type InitConfig struct {
	// CNIConfigDir is directory where the cni config files are stored.
	CNIConfigDir string
	// CNIPluginDirs is a list of directories where cni should look for the plugins.
	CNIPluginDirs []string
	// RunDir is a directory where temporary files can be stored.
	RunDir string

	// DefaultNetwork is the name for the default network.
	DefaultNetwork string
	// DefaultSubnet is the default subnet for the default network.
	DefaultSubnet string

	// DefaultsubnetPools contains the subnets which must be used to allocate a free subnet by network create
	DefaultsubnetPools []config.SubnetPool

	// IsMachine describes whenever podman runs in a podman machine environment.
	IsMachine bool
}

type VLANConfig

type VLANConfig struct {
	PluginType   string          `json:"type"`
	Master       string          `json:"master"`
	IPAM         ipamConfig      `json:"ipam"`
	MTU          int             `json:"mtu,omitempty"`
	Mode         string          `json:"mode,omitempty"`
	Capabilities map[string]bool `json:"capabilities,omitempty"`
}

VLANConfig describes the macvlan config

Jump to

Keyboard shortcuts

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