rootlessnetns

package
v0.58.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Netns

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

func New

func New(dir string, backend NetworkBackend, conf *config.Config) (*Netns, error)

func (*Netns) Run

func (n *Netns) Run(lock *lockfile.LockFile, toRun func() error) error

Run any long running function in the userns. We need to ensure that during setup/cleanup we are locked to avoid races. However because the given function could be running a long time we must unlock in between, i.e. this is used by podman unshare --rootless-nets and we do not want to keep it locked for the lifetime of the given command.

func (*Netns) Setup

func (n *Netns) Setup(nets int, toRun func() error) error

func (*Netns) Teardown

func (n *Netns) Teardown(nets int, toRun func() error) error

type NetworkBackend

type NetworkBackend int
const (
	Netavark NetworkBackend = iota
	CNI
)

Jump to

Keyboard shortcuts

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