idtools

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemapDir

func RemapDir(ctx context.Context, originalMountpoint, newMountpoint string, idMap IDMap) error

func RemapRoot

func RemapRoot(ctx context.Context, root string, idMap IDMap) error

func RemapRootFS

func RemapRootFS(ctx context.Context, mounts []mount.Mount, idmap IDMap) error

Types

type IDMap

type IDMap struct {
	UidMap []specs.LinuxIDMapping `json:"UidMap"`
	GidMap []specs.LinuxIDMapping `json:"GidMap"`
}

IDMap contains the mappings of Uids and Gids.

func LoadIDMap

func LoadIDMap(id string, labels map[string]string) (IDMap, error)

func (IDMap) Empty

func (i IDMap) Empty() bool

Empty returns true if there are no id mappings

func (IDMap) ToHost

func (i IDMap) ToHost(pair User) (User, error)

ToHost returns the host user ID pair for the container ID pair.

func (*IDMap) Unmarshal

func (i *IDMap) Unmarshal(uidMap, gidMap string) error

Unmarshal deserialize the passed uidmap and gidmap strings into a IDMap object. Error is returned in case of failure

type User

type User struct {
	Uid uint32
	Gid uint32
}

User is a Uid and Gid pair of a user

Jump to

Keyboard shortcuts

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