Documentation ¶
Index ¶
- Variables
- func CreatePidFile(path string, pid int) error
- func DecodeFileJSON(obj interface{}, src string) error
- type ContainerInfo
- type Runtime
- func (c *Runtime) ConfigureLogging(cmdName string) error
- func (c *Runtime) Create(ctx context.Context, spec *specs.Spec) error
- func (c *Runtime) Delete(ctx context.Context, force bool) error
- func (c *Runtime) Exec(args []string, proc *specs.Process) (exitStatus int, err error)
- func (c *Runtime) ExecDetached(args []string, proc *specs.Process) (pid int, err error)
- func (c *Runtime) Kill(ctx context.Context, signum unix.Signal) error
- func (c Runtime) Release() error
- func (c *Runtime) Start(ctx context.Context) error
- func (c *Runtime) State() (*specs.State, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrExist = fmt.Errorf("container already exists")
View Source
var ErrNotExist = fmt.Errorf("container does not exist")
Functions ¶
func CreatePidFile ¶
createPidFile atomically creates a pid file for the given pid at the given path
func DecodeFileJSON ¶
Types ¶
type ContainerInfo ¶
type ContainerInfo struct { ContainerID string CreatedAt time.Time RuntimeRoot string BundlePath string ConsoleSocket string `json:",omitempty"` // PidFile is the absolute path to the PID file of the container monitor process (crio-lxc-start) PidFile string MonitorCgroupDir string // values derived from spec CgroupDir string // feature gates Seccomp bool Capabilities bool Apparmor bool CgroupDevices bool // values duplicated from bundle.json // annotations are required for 'state' Annotations map[string]string `json:",omitempty"` // namespaces are required for 'exec' Namespaces []specs.LinuxNamespace `json:",omitempty"` }
ContainerInfo holds the information about a single container. It is created at 'create' within the container runtime dir and not changed afterwards. It is removed when the container is deleted.
func (ContainerInfo) ConfigFilePath ¶
func (c ContainerInfo) ConfigFilePath() string
func (*ContainerInfo) Create ¶
func (c *ContainerInfo) Create() error
func (ContainerInfo) CreatePidFile ¶
func (c ContainerInfo) CreatePidFile(pid int) error
func (*ContainerInfo) Load ¶
func (c *ContainerInfo) Load() error
RuntimeRoot and ContainerID must be set
func (ContainerInfo) Pid ¶
func (c ContainerInfo) Pid() (int, error)
func (ContainerInfo) RuntimePath ¶
func (c ContainerInfo) RuntimePath(subPath ...string) string
RuntimePath returns the absolute path witin the container root
type Runtime ¶
type Runtime struct { Container *lxc.Container ContainerInfo // [ global settings ] LogFile *os.File LogFilePath string LogLevel string LogTimestamp string ContainerLogLevel string SystemdCgroup bool MonitorCgroup string StartCommand string InitCommand string ContainerHook string Log zerolog.Logger }
func (*Runtime) ConfigureLogging ¶
func (*Runtime) ExecDetached ¶
Click to show internal directories.
Click to hide internal directories.