utils

package
v0.0.0-...-9f13f69 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 16 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUpIPAM

func CleanUpIPAM(conf types.NetConf, args *skel.CmdArgs, logger *logrus.Entry) error

CleanUpIPAM calls IPAM plugin to release the IP address. It also contains IPAM plugin specific changes needed before calling the plugin.

func CleanUpNamespace

func CleanUpNamespace(args *skel.CmdArgs, logger *logrus.Entry) error

CleanUpNamespace deletes the devices in the network namespace.

func ConfigureIPForwarding

func ConfigureIPForwarding(hasIPv4, hasIPv6, enable bool) error

func ConfigureLogging

func ConfigureLogging(logLevel string)

Set up logging for both Calico and libcalico using the provided log level,

func DoNetworking

func DoNetworking(destNetworks []*net.IPNet, ips []*current.IPConfig, contNetNS, contVethName, hostVethName string, ipForward bool, logger *logrus.Entry) (contVethMAC string, err error)

DoNetworking performs the networking for the given config and IPAM result

func GetCurrentThreadNetNSPath

func GetCurrentThreadNetNSPath() string

GetCurrentThreadNetNSPath returns the string to represent the current namespace of the current thread. This is an exported copy of getCurrentThreadNetNSPath from github.com/containernetworking/plugins/pkg/ns/ns_linux.go

func Min

func Min(a, b int) int

func ReleaseIPAllocation

func ReleaseIPAllocation(logger *logrus.Entry, ipamType string, stdinData []byte)

ReleaseIPAllocation is called to cleanup IPAM allocations if something goes wrong during CNI ADD execution.

Types

type WEPIdentifiers

type WEPIdentifiers struct {
	ContainerID string
	Endpoint    string
	Namespace   string
	Pod         string
}

func GetIdentifiers

func GetIdentifiers(args *skel.CmdArgs) (*WEPIdentifiers, error)

GetIdentifiers takes CNI command arguments, and extracts identifiers i.e. pod name, pod namespace, container ID, endpoint(container interface name) and orchestratorID based on the orchestrator.

Jump to

Keyboard shortcuts

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