Documentation
¶
Index ¶
Constants ¶
View Source
const ( LocalNetName = "lo" DefNetName = "net" PluginConfDir = "/etc/cni/net.d" PluginBinDir = "/opt/cni/bin" )
CNI default values to find plugins and configurations.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NetworkPlugin ¶
type NetworkPlugin struct {
// contains filtered or unexported fields
}
NetworkPlugin is the CNI network plugin handler.
func NewNetworkPlugin ¶
func NewNetworkPlugin() (*NetworkPlugin, error)
NewNetworkPlugin initialize the CNI network plugin and returns a handler to it.
func (*NetworkPlugin) AddNetwork ¶
func (plugin *NetworkPlugin) AddNetwork(podID string, netNSPath string, ifName string) (*types.Result, error)
AddNetwork calls the CNI plugin to create a network between the host and the network namespace.
func (*NetworkPlugin) RemoveNetwork ¶
func (plugin *NetworkPlugin) RemoveNetwork(podID string, netNSPath string, ifName string) error
RemoveNetwork calls the CNI plugin to remove a specific network previously created between the host and the network namespace.
Click to show internal directories.
Click to hide internal directories.