Documentation ¶
Index ¶
- Variables
- func CmdAdd(cniNetns, cniContainerID, cniIfname string, conf []byte, f func() error) (types.Result, []byte, error)
- func CmdAddWithArgs(args *skel.CmdArgs, f func() error) (types.Result, []byte, error)
- func CmdCheck(cniNetns, cniContainerID, cniIfname string, conf []byte, f func() error) error
- func CmdCheckWithArgs(args *skel.CmdArgs, f func() error) error
- func CmdDel(cniNetns, cniContainerID, cniIfname string, f func() error) error
- func CmdDelWithArgs(args *skel.CmdArgs, f func() error) error
- func NewNS() (ns.NetNS, error)
- func Ping(saddr, daddr string, timeoutSec int) error
- func SpecVersionHasCHECK(ver string) bool
- func SpecVersionHasChaining(ver string) bool
- func SpecVersionHasIPVersion(ver string) bool
- func SpecVersionHasMultipleIPs(ver string) bool
- func TmpResolvConf(dnsConf types.DNS) (string, error)
- func UnmountNS(ns ns.NetNS) error
- type BadReader
Constants ¶
This section is empty.
Variables ¶
var AllSpecVersions = [...]string{"0.1.0", "0.2.0", "0.3.0", "0.3.1", "0.4.0", "1.0.0"}
AllSpecVersions contains all CNI spec version numbers
Functions ¶
func CmdAddWithArgs ¶
func NewNS ¶
Creates a new persistent (bind-mounted) network namespace and returns an object representing that namespace, without switching to it.
func SpecVersionHasCHECK ¶
SpecVersionHasCHECK returns true if the given CNI specification version supports the CHECK command
func SpecVersionHasChaining ¶
SpecVersionHasChaining returns true if the given CNI specification version supports plugin chaining
func SpecVersionHasIPVersion ¶
SpecVersionHasIPVersion returns true if the given CNI specification version includes the "version" field in the IP address elements
func SpecVersionHasMultipleIPs ¶
SpecVersionHasMultipleIPs returns true if the given CNI specification version supports more than one IP address of each family
func TmpResolvConf ¶
TmpResolvConf will create a temporary file and write the provided DNS settings to it in the resolv.conf format. It returns the path of the created temporary file or an error if any occurs while creating/writing the file. It is the caller's responsibility to remove the file.