cni

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package cni provides the core logic to call CNI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNS

func GetNS(name string) (ns.NetNS, error)

GetNS returns the netns object for the current thread

func NewNS

func NewNS(name string) (ns.NetNS, error)

NewNS creates a new persistent (bind-mounted) network namespace and returns an object representing that namespace, without switching to it.

func Remove

func Remove(ctx context.Context, id, name, namespace string) (err error)

Remove removes the CNI network for the given container.

func Setup

func Setup(ctx context.Context, id, name, namespace string) (ip []string, err error)

Setup sets up the CNI network for the given container.

func UnmountNS

func UnmountNS(ns ns.NetNS) error

UnmountNS unmounts the NS held by the netns object

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL