Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNetNS ¶
func DestroyNetNS ¶
func GetPodIP ¶ added in v0.8.0
func GetPodIP(result *cnicurrent.Result) string
GetPodIP retrieves the IP address of the pod as a string. It uses the first IPv4 address if finds. If it fails to determine the pod IP or the result argument is nil, it returns an empty string.
func PodNetNSPath ¶
func ReadConfiguration ¶
func ReadConfiguration(configDir string) (*libcni.NetworkConfigList, error)
Types ¶
type CNIClient ¶ added in v0.9.4
type CNIClient interface { // AddSandboxToNetwork adds a pod sandbox to the CNI network AddSandboxToNetwork(podId, podName, podNs string) (*cnicurrent.Result, error) // RemoveSandboxFromNetwork removes a pod sandbox from the CNI network RemoveSandboxFromNetwork(podId, podName, podNs string) error // GetDummyNetwork creates a dummy network using CNI plugin. // It's used for making a dummy gateway for Calico CNI plugin GetDummyNetwork() (*cnicurrent.Result, string, error) }
CNIClient provides an interface to CNI
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddSandboxToNetwork ¶
func (c *Client) AddSandboxToNetwork(podId, podName, podNs string) (*cnicurrent.Result, error)
AddSandboxToNetwork implements AddSandboxToNetwork method of CNIClient interface
func (*Client) GetDummyNetwork ¶ added in v0.9.0
func (c *Client) GetDummyNetwork() (*cnicurrent.Result, string, error)
GetDummyNetwork implements GetDummyNetwork method of CNIClient interface
func (*Client) RemoveSandboxFromNetwork ¶
RemoveSandboxFromNetwork implements RemoveSandboxFromNetwork method of CNIClient interface
Click to show internal directories.
Click to hide internal directories.