package netns

import "github.com/containerd/containerd/pkg/netns"

Index

Types

type NetNS

type NetNS struct {
	// contains filtered or unexported fields
}

NetNS holds network namespace.

func LoadNetNS

func LoadNetNS(path string) *NetNS

LoadNetNS loads existing network namespace.

func NewNetNS

func NewNetNS(baseDir string) (*NetNS, error)

NewNetNS creates a network namespace.

func (*NetNS) Closed

func (n *NetNS) Closed() (bool, error)

Closed checks whether the network namespace has been closed.

func (*NetNS) Do

func (n *NetNS) Do(f func(cnins.NetNS) error) error

Do runs a function in the network namespace.

func (*NetNS) GetPath

func (n *NetNS) GetPath() string

GetPath returns network namespace path for sandbox container

func (*NetNS) Remove

func (n *NetNS) Remove() error

Remove removes network namespace. Remove is idempotent, meaning it might be invoked multiple times and provides consistent result.

Source Files

netns_linux.go

Version
v1.5.6
Published
Sep 29, 2021
Platform
linux/amd64
Imports
11 packages
Last checked
36 minutes ago

Tools for package owners.