Documentation ¶
Index ¶
- Constants
- func CheckSysctlValue(sysctlPath, value string) error
- func Cmd(cmd string) string
- func CreateContainer(netconf, podName, podNamespace string, ip string) (container_id string, session *gexec.Session, contVeth netlink.Link, ...)
- func CreateContainerNamespace() (containerNs ns.NetNS, containerId string, err error)
- func CreateContainerNamespaceWithCid(container_id string) (containerNs ns.NetNS, containerId string, err error)
- func CreateContainerWithId(netconf, podName, podNamespace, ip, containerId string) (container_id string, session *gexec.Session, contVeth netlink.Link, ...)
- func CreateHostVeth(containerId string, k8sName string, k8sNamespace string) error
- func DeleteContainer(netconf, netnspath, podName, podNamespace string) (exitCode int, err error)
- func DeleteContainerWithId(netconf, netnspath, podName, podNamespace, containerId string) (exitCode int, err error)
- func GetResultForCurrent(session *gexec.Session, cniVersion string) (*current.Result, error)
- func MustCreateNewIPPool(c client.Interface, cidr string, ipip, natOutgoing, ipam bool)
- func RunCNIPluginWithId(netconf, podName, podNamespace, ip, containerId, ifName string, ...) (session *gexec.Session, contVeth netlink.Link, contAddr []netlink.Addr, ...)
- func RunIPAMPlugin(netconf, command, args, cniVersion string) (*current.Result, types.Error, int)
- func WipeEtcd()
- func WipeK8sPods()
Constants ¶
const K8S_TEST_NS = "test"
const TEST_DEFAULT_NS = "default"
Variables ¶
This section is empty.
Functions ¶
func CheckSysctlValue ¶
CheckSysctlValue is a utility function to assert sysctl value is set to what is expected.
func CreateContainer ¶
func CreateContainerWithId ¶
func CreateContainerWithId(netconf, podName, podNamespace, ip, containerId string) (container_id string, session *gexec.Session, contVeth netlink.Link, contAddr []netlink.Addr, contRoutes []netlink.Route, targetNs ns.NetNS, err error)
Create container with the giving containerId when containerId is not empty
func CreateHostVeth ¶
Create veth pair on host
func DeleteContainer ¶
Executes the Calico CNI plugin and return the error code of the command.
func DeleteContainerWithId ¶
func GetResultForCurrent ¶
GetResultForCurrent takes the session output with cniVersion and returns the Result in current.Result format.
func MustCreateNewIPPool ¶
MustCreateNewIPPool creates a new Calico IPAM IP Pool.
func RunCNIPluginWithId ¶
func RunCNIPluginWithId(netconf, podName, podNamespace, ip, containerId, ifName string, targetNs ns.NetNS) (session *gexec.Session, contVeth netlink.Link, contAddr []netlink.Addr, contRoutes []netlink.Route, err error)
RunCNIPluginWithId calls CNI plugin with a containerID and targetNs passed to it. This is for when you want to call CNI for an existing container.
func RunIPAMPlugin ¶
RunIPAMPlugin sets ENV vars required then calls the IPAM plugin specified in the config and returns the result and exitCode.
Types ¶
This section is empty.