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 for sandbox

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 for the sandbox.

func NewNetNSFromPID

func NewNetNSFromPID(baseDir string, pid uint32) (*NetNS, error)

NewNetNS returns the netns from pid or a new netns if pid is 0.

func (*NetNS) Closed

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

Closed checks whether the network namespace has been closed.

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 if it exists and not closed. Remove is idempotent, meaning it might be invoked multiple times and provides consistent result.

Source Files

netns_windows.go

Version
v1.7.22
Published
Sep 9, 2024
Platform
windows/amd64
Imports
2 packages
Last checked
1 minute ago

Tools for package owners.