cnidel

package
v4.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CniAddOp = "ADD"
	CniDelOp = "DEL"
)

Variables

View Source
var (
	SupportedNativeCnis = map[string]*datastructs.CniBackendConfig{
		"sriov": &datastructs.CniBackendConfig{
			CNIVersion:   "0.3.1",
			ReadConfig:   datastructs.CniConfigReader(getSriovCniConfig),
			IpamNeeded:   true,
			DeviceNeeded: true,
		},
		"macvlan": &datastructs.CniBackendConfig{
			CNIVersion:   "0.3.1",
			ReadConfig:   datastructs.CniConfigReader(getMacvlanCniConfig),
			IpamNeeded:   true,
			DeviceNeeded: false,
		},
	}
)

Functions

func DelegateInterfaceDelete

func DelegateInterfaceDelete(netConf *datastructs.NetConf, netInfo *danmtypes.DanmNet, ep *danmtypes.DanmEp) error

DelegateInterfaceDelete delegates Ks8 Pod network interface delete task to the input 3rd party CNI plugin Returns an error if interface creation was unsuccessful, or if the 3rd party CNI config could not be loaded

func DelegateInterfaceSetup

func DelegateInterfaceSetup(netConf *datastructs.NetConf, wasIpReservedByDanmIpam bool, netInfo *danmtypes.DanmNet, ep *danmtypes.DanmEp) (*current.Result, error)

DelegateInterfaceSetup delegates K8s Pod network interface setup task to the input 3rd party CNI plugin Returns the CNI compatible result object, or an error if interface creation was unsuccessful, or if the 3rd party CNI config could not be loaded TODO: I hate myself for the bool input parameter, but that's what we are going with for the time being. Could be this information cleverly defaulted from existing DanmEp spec in all cases?

func FreeDelegatedIps

func FreeDelegatedIps(netInfo *danmtypes.DanmNet, ip4, ip6 string) error

func GetEnv

func GetEnv(key, fallback string) string

func IsDanmIpamNeededForDelegation

func IsDanmIpamNeededForDelegation(iface datastructs.Interface, netInfo *danmtypes.DanmNet) bool

func IsDelegationRequired

func IsDelegationRequired(netInfo *danmtypes.DanmNet) bool

IsDelegationRequired decides if the interface creation operations should be delegated to a 3rd party CNI, or can be handled by DANM Decision is made based on the NetworkType parameter of the network object

func IsDeviceNeeded

func IsDeviceNeeded(cniType string) bool

Types

type MacvlanNet

type MacvlanNet struct {
	types.NetConf
	//Name of the master NIC the MACVLAN slave needs to be connected to
	Master string `json:"master"`
	//The mode in which the MACVLAN slave is configured (default bridge)
	Mode string `json:"mode"`
	//MTU to be set to the MACVLAN slave interface (default 1500)
	MTU int `json:"mtu"`
	//IPAM configuration to be used for this network
	Ipam datastructs.IpamConfig `json:"ipam,omitEmpty"`
}

type SriovNet

type SriovNet struct {
	sriov_types.NetConf
	// IPAM configuration to be used for this network
	Ipam datastructs.IpamConfig `json:"ipam,omitEmpty"`
}

sriovNet represent the configuration of sriov cni v1.0.0

Jump to

Keyboard shortcuts

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