Documentation ¶
Overview ¶
Copyright 2015 Tigera Inc
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 ¶
- func AddIgnoreUnknownArgs() error
- func CleanUpIPAM(conf types.NetConf, args *skel.CmdArgs, logger *logrus.Entry) error
- func CleanUpNamespace(args *skel.CmdArgs, logger *logrus.Entry) error
- func ConfigureLogging(logLevel string)
- func CreateClient(conf types.NetConf) (client.Interface, error)
- func CreateOrUpdate(ctx context.Context, client client.Interface, wep *api.WorkloadEndpoint) (*api.WorkloadEndpoint, error)
- func CreateResultFromEndpoint(wep *api.WorkloadEndpoint) (*current.Result, error)
- func DetermineNodename(conf types.NetConf) string
- func DoNetworking(args *skel.CmdArgs, conf types.NetConf, result *current.Result, ...) (hostVethName, contVethMAC string, err error)
- func GetHandleID(netName string, containerID string, workload string) (string, error)
- func Min(a, b int) int
- func ParsePools(pools []string, isv4 bool) ([]cnet.IPNet, error)
- func PopulateEndpointNets(wep *api.WorkloadEndpoint, result *current.Result) error
- func ReleaseIPAllocation(logger *logrus.Entry, ipamType string, stdinData []byte)
- func SetupRoutes(hostVeth netlink.Link, result *current.Result) error
- func ValidateNetworkName(name string) error
- type WEPIdentifiers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddIgnoreUnknownArgs ¶
func AddIgnoreUnknownArgs() error
AddIgnoreUnknownArgs appends the 'IgnoreUnknown=1' option to CNI_ARGS before calling the IPAM plugin. Otherwise, it will complain about the Kubernetes arguments. See https://github.com/kubernetes/kubernetes/pull/24983
func CleanUpIPAM ¶ added in v1.7.0
CleanUpIPAM calls IPAM plugin to release the IP address. It also contains IPAM plugin specific changes needed before calling the plugin.
func CleanUpNamespace ¶ added in v1.7.0
CleanUpNamespace deletes the devices in the network namespace.
func ConfigureLogging ¶
func ConfigureLogging(logLevel string)
Set up logging for both Calico and libcalico using the provided log level,
func CreateOrUpdate ¶
func CreateOrUpdate(ctx context.Context, client client.Interface, wep *api.WorkloadEndpoint) (*api.WorkloadEndpoint, error)
CreateOrUpdate creates the WorkloadEndpoint if ResourceVersion is not specified, or Update if it's specified.
func CreateResultFromEndpoint ¶
func CreateResultFromEndpoint(wep *api.WorkloadEndpoint) (*current.Result, error)
CreateResultFromEndpoint takes a WorkloadEndpoint, extracts IP information and populates that into a CNI Result.
func DetermineNodename ¶
DetermineNodename gets the node name, in order of priority: 1. Hostname field in NetConf (DEPRECATED). 2. Nodename field in NetConf. 3. OS Hostname.
func DoNetworking ¶
func DoNetworking(args *skel.CmdArgs, conf types.NetConf, result *current.Result, logger *logrus.Entry, desiredVethName string) (hostVethName, contVethMAC string, err error)
DoNetworking performs the networking for the given config and IPAM result
func GetHandleID ¶ added in v1.11.2
func ParsePools ¶ added in v1.6.0
Takes as array of IPv4 or IPv6 pools and parses them into an array of IPnet's
func PopulateEndpointNets ¶
func PopulateEndpointNets(wep *api.WorkloadEndpoint, result *current.Result) error
PopulateEndpointNets takes a WorkloadEndpoint and a CNI Result, extracts IP address and mask and populates that information into the WorkloadEndpoint.
func ReleaseIPAllocation ¶
ReleaseIPAllocation is called to cleanup IPAM allocations if something goes wrong during CNI ADD execution.
func SetupRoutes ¶ added in v1.11.1
SetupRoutes sets up the routes for the host side of the veth pair.
func ValidateNetworkName ¶
ValidateNetworkName checks that the network name meets felix's expectations
Types ¶
type WEPIdentifiers ¶
type WEPIdentifiers struct { Namespace string WEPName string names.WorkloadEndpointIdentifiers }
func GetIdentifiers ¶
func GetIdentifiers(args *skel.CmdArgs, nodename string) (*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.