Documentation
¶
Overview ¶
* Tencent is pleased to support the open source community by making TKEStack available. * * Copyright (C) 2012-2019 Tencent. 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 * * https://opensource.org/licenses/Apache-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 OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func BuildCNIArgs(args map[string]string) string
- func CmdAdd(cmdArgs *skel.CmdArgs, networkInfos []*NetworkInfo) (types.Result, error)
- func CmdDel(cmdArgs *skel.CmdArgs, lastIdx int) error
- func ConfigureIface(ifName string, res *t020.Result) error
- func DelegateAdd(netconf map[string]interface{}, args *skel.CmdArgs, ifName string) (types.Result, error)
- func DelegateDel(netconf map[string]interface{}, args *skel.CmdArgs, ifName string) error
- func GetNetworkConfig(networkName, confdir string) ([]byte, error)
- func IPInfoToResult(ipInfo *constant.IPInfo) *t020.Result
- func ParseCNIArgs(args string) (map[string]string, error)
- type NetworkInfo
Constants ¶
const ( // CNI_ARGS="IP=192.168.33.3" // CNI_COMMAND="ADD" // CNI_CONTAINERID=ctn1 // CNI_NETNS=/var/run/netns/ctn // CNI_IFNAME=eth0 // CNI_PATH=$CNI_PATH CNI_ARGS = "CNI_ARGS" CNI_COMMAND = "CNI_COMMAND" CNI_CONTAINERID = "CNI_CONTAINERID" CNI_NETNS = "CNI_NETNS" CNI_IFNAME = "CNI_IFNAME" CNI_PATH = "CNI_PATH" COMMAND_ADD = "ADD" COMMAND_DEL = "DEL" )
Variables ¶
This section is empty.
Functions ¶
func BuildCNIArgs ¶
BuildCNIArgs builds cni args as string such as key1=val1;key2=val2
func ConfigureIface ¶
ConfigureIface takes the result of IPAM plugin and applies to the ifName interface
func DelegateAdd ¶
func DelegateAdd(netconf map[string]interface{}, args *skel.CmdArgs, ifName string) (types.Result, error)
DelegateAdd calles delegate cni binary to execute cmdAdd
func DelegateDel ¶
DelegateDel calles delegate cni binary to execute cmdDEL
func GetNetworkConfig ¶
func IPInfoToResult ¶
IPInfoToResult converts IPInfo to Result
Types ¶
type NetworkInfo ¶
type NetworkInfo struct { NetworkType string Args map[string]string Conf map[string]interface{} IfName string }
NetworkInfo wraps network infos which are needed for cni plugin to setup network
func NewNetworkInfo ¶
func NewNetworkInfo(networkType string, conf map[string]interface{}, ifName string) *NetworkInfo
NewNetworkInfo creates a NetworkInfo