Documentation ¶
Overview ¶
Copyright (c) 2015-2021 Tigera, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2015-2020 Tigera, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func AddNode(c client.Interface, kc *kubernetes.Clientset, host string) error
- func CheckSysctlValue(sysctlPath, value string) error
- func Cmd(cmd string) string
- func CreateContainer(netconf, podName, podNamespace, ip string) (containerID string, result *cniv1.Result, contVeth netlink.Link, ...)
- func CreateContainerNamespace() (containerNs ns.NetNS, containerId string, err error)
- func CreateContainerWithId(netconf, podName, podNamespace, ip, overrideContainerID string) (containerID string, result *cniv1.Result, contVeth netlink.Link, ...)
- func CreateHostVeth(containerId, k8sName, k8sNamespace, nodename 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 DeleteContainerWithIdAndIfaceName(netconf, netnspath, podName, podNamespace, containerId, ifaceName string) (exitCode int, err error)
- func DeleteNode(c client.Interface, kc *kubernetes.Clientset, host string) error
- func GetResultForCurrent(session *gexec.Session, cniVersion string) (*cniv1.Result, error)
- func MustCreateNewIPPool(c client.Interface, cidr string, ipip, natOutgoing, ipam bool) string
- func MustCreateNewIPPoolBlockSize(c client.Interface, cidr string, ipip, natOutgoing, ipam bool, blockSize int) string
- func MustDeleteIPPool(c client.Interface, cidr string)
- func RunCNIPluginWithId(netconf, podName, podNamespace, ip, containerId, ifName string, ...) (result *cniv1.Result, contVeth netlink.Link, contAddr []netlink.Addr, ...)
- func RunIPAMPlugin(netconf, command, args, cid, cniVersion string) (*cniv1.Result, types.Error, int)
- func WipeDatastore()
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, overrideContainerID string) (containerID string, result *cniv1.Result, 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 DeleteNode ¶
func GetResultForCurrent ¶
GetResultForCurrent takes the output with cniVersion and returns the Result in cniv1.Result format.
func MustCreateNewIPPool ¶
MustCreateNewIPPool creates a new Calico IPAM IP Pool.
func MustCreateNewIPPoolBlockSize ¶
func MustCreateNewIPPoolBlockSize(c client.Interface, cidr string, ipip, natOutgoing, ipam bool, blockSize int) string
MustCreateNewIPPoolBlockSize creates a new Calico IPAM IP Pool with support for setting the block size.
func MustDeleteIPPool ¶
func RunCNIPluginWithId ¶
func RunCNIPluginWithId( netconf, podName, podNamespace, ip, containerId, ifName string, targetNs ns.NetNS, ) ( result *cniv1.Result, 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.
Types ¶
This section is empty.