rootlessutil

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetachedNetNS

func DetachedNetNS() (string, error)

DetachedNetNS returns non-empty netns path if RootlessKit is running with --detach-netns mode. Otherwise returns "" without an error.

func IsRootless

func IsRootless() bool

func IsRootlessChild

func IsRootlessChild() bool

func IsRootlessParent

func IsRootlessParent() bool

func NewRootlessKitClient

func NewRootlessKitClient() (client.Client, error)

func ParentEGID

func ParentEGID() int

func ParentEUID

func ParentEUID() int

func ParentMain

func ParentMain(hostGatewayIP string) error

func RootlessContainredSockAddress

func RootlessContainredSockAddress() (string, error)

RootlessContainredSockAddress returns sock address of rootless containerd based on https://github.com/containerd/nerdctl/blob/main/docs/faq.md#containerd-socket-address

func RootlessKitChildPid

func RootlessKitChildPid(stateDir string) (int, error)

func RootlessKitStateDir

func RootlessKitStateDir() (string, error)

func WithDetachedNetNSIfAny

func WithDetachedNetNSIfAny(fn func() error) error

WithDetachedNetNSIfAny executes fn in DetachedNetNS if RootlessKit is running with --detach-netns mode. Otherwise it just executes fn in the current netns.

func XDGConfigHome

func XDGConfigHome() (string, error)

func XDGDataHome

func XDGDataHome() (string, error)

func XDGRuntimeDir

func XDGRuntimeDir() (string, error)

Types

type RootlessCNIPortManager

type RootlessCNIPortManager struct {
	client.Client
}

func NewRootlessCNIPortManager

func NewRootlessCNIPortManager(client client.Client) (*RootlessCNIPortManager, error)

func (*RootlessCNIPortManager) ExposePort

func (rlcpm *RootlessCNIPortManager) ExposePort(ctx context.Context, cpm cni.PortMapping) error

func (*RootlessCNIPortManager) UnexposePort

func (rlcpm *RootlessCNIPortManager) UnexposePort(ctx context.Context, cpm cni.PortMapping) error

Jump to

Keyboard shortcuts

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