Documentation
¶
Index ¶
- func CheckHostConfig(context *cli.Context, spec *specs.Spec) error
- func CheckUidShifting(sysMgr *Mgr, spec *specs.Spec) (sh.IDShiftType, sh.IDShiftType, error)
- type Fs
- func (fs *Fs) Enabled() bool
- func (fs *Fs) GetConfig() error
- func (fs *Fs) PreRegister(linuxNamespaces []specs.LinuxNamespace) error
- func (fs *Fs) Register(info *FsRegInfo) error
- func (fs *Fs) SendCreationTime(t time.Time) error
- func (fs *Fs) SendSeccompInit(pid int, id string, seccompFd int32) error
- func (fs *Fs) Unregister() error
- type FsRegInfo
- type Mgr
- func (mgr *Mgr) ChownClonedRootfs(uidOffset, gidOffset int32) error
- func (mgr *Mgr) CloneRootfs() (string, error)
- func (mgr *Mgr) Enabled() bool
- func (mgr *Mgr) GetClonedRootfs() string
- func (mgr *Mgr) IsRootfsCloned() bool
- func (mgr *Mgr) Pause() error
- func (mgr *Mgr) PrepMounts(uid, gid uint32, prepList []ipcLib.MountPrepInfo) error
- func (mgr *Mgr) Register(spec *specs.Spec) error
- func (mgr *Mgr) ReqFsState(rootfs string) ([]configs.FsEntry, error)
- func (mgr *Mgr) ReqMounts(rootfsUidShiftType sh.IDShiftType, reqList []ipcLib.MountReqInfo) ([]specs.Mount, error)
- func (mgr *Mgr) ReqShiftfsMark(mounts []shiftfs.MountPoint) ([]shiftfs.MountPoint, error)
- func (mgr *Mgr) ReqSubid(size uint32) (uint32, uint32, error)
- func (mgr *Mgr) Resume() error
- func (mgr *Mgr) RevertClonedRootfsChown() error
- func (mgr *Mgr) Unregister() error
- func (mgr *Mgr) Update(userns, netns string, uidMappings, gidMappings []specs.LinuxIDMapping, ...) error
- type Sysbox
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckHostConfig ¶
CheckHostConfig checks if the host is configured appropriately to run a container with sysbox
func CheckUidShifting ¶
func CheckUidShifting(sysMgr *Mgr, spec *specs.Spec) (sh.IDShiftType, sh.IDShiftType, error)
checkUidShifting returns the type of UID shifting needed (if any) for the container. The first return value indicates the type of UID shifting to be used for the container's rootfs, while the second indicates the type of UID shifting for container bind-mounts.
Types ¶
type Fs ¶
type Fs struct { Active bool Id string // container-id PreReg bool // indicates if the container was pre-registered with sysbox-fs Reg bool // indicates if sys container was registered with sysbox-fs Mountpoint string // sysbox-fs FUSE mountpoint }
func (*Fs) PreRegister ¶
func (fs *Fs) PreRegister(linuxNamespaces []specs.LinuxNamespace) error
Pre-registers container with sysbox-fs.
func (*Fs) SendCreationTime ¶
Sends container creation time to sysbox-fs
func (*Fs) SendSeccompInit ¶
Sends the seccomp-notification fd to sysbox-fs (tracer) to setup syscall trapping and waits for its response (ack).
type FsRegInfo ¶
type FsRegInfo struct { Hostname string Pid int Uid int Gid int IdSize int ProcRoPaths []string ProcMaskPaths []string }
FsRegInfo contains info about a sys container registered with sysbox-fs
type Mgr ¶
type Mgr struct { Active bool Id string // container-id Config *ipcLib.ContainerConfig // sysbox-mgr mandated container config // contains filtered or unexported fields }
func (*Mgr) ChownClonedRootfs ¶
Sends a requests to sysbox-mgr to chown a cloned rootfs, using the given uid and gid offsets. Must call after CloneRootfs().
func (*Mgr) CloneRootfs ¶
ClonedRootfs sends a request to sysbox-mgr to setup an alternate rootfs for the container. It returns the path to the new rootfs.
func (*Mgr) GetClonedRootfs ¶
func (*Mgr) IsRootfsCloned ¶
func (*Mgr) PrepMounts ¶
func (mgr *Mgr) PrepMounts(uid, gid uint32, prepList []ipcLib.MountPrepInfo) error
PrepMounts sends a request to sysbox-mgr for prepare the given container mounts; all paths must be absolute.
func (*Mgr) Register ¶
Registers the container with sysbox-mgr. If successful, stores the sysbox configuration tokens for sysbox-runc in mgr.Config
func (*Mgr) ReqFsState ¶
ReqFsState sends a request to sysbox-mgr for container's rootfs state.
func (*Mgr) ReqMounts ¶
func (mgr *Mgr) ReqMounts(rootfsUidShiftType sh.IDShiftType, reqList []ipcLib.MountReqInfo) ([]specs.Mount, error)
ReqMounts sends a request to sysbox-mgr for container mounts; all paths must be absolute.
func (*Mgr) ReqShiftfsMark ¶
func (mgr *Mgr) ReqShiftfsMark(mounts []shiftfs.MountPoint) ([]shiftfs.MountPoint, error)
ReqShiftfsMark sends a request to sysbox-mgr to mark shiftfs on the given dirs; all paths must be absolute.
func (*Mgr) ReqSubid ¶
ReqSubid requests sysbox-mgr to allocate uid & gids for the container user-ns.
func (*Mgr) RevertClonedRootfsChown ¶
Sends a requests to sysbox-mgr to revert the chown of a cloned rootfs. Must call after ChownClonedRootfs().
func (*Mgr) Unregister ¶
Unregisters the container with sysbox-mgr.
func (*Mgr) Update ¶
func (mgr *Mgr) Update(userns, netns string, uidMappings, gidMappings []specs.LinuxIDMapping, rootfsUidShiftType sh.IDShiftType) error