rescontainerpodman

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DrvID = driver.NewID(driver.GroupContainer, "podman")
)

Functions

func IsGenuine

func IsGenuine() bool

func New

func New() resource.Driver

Types

type ExecutorArg

type ExecutorArg struct {
	*rescontainerocibase.ExecutorArg
	// contains filtered or unexported fields
}

func (*ExecutorArg) Credential

func (ea *ExecutorArg) Credential() (*rescontainerocibase.Credential, error)

Credential implements rescontainerocibase.ExecutorCredentialer: the podman commands of a rootless container run as its user.

func (*ExecutorArg) ExecBaseArgs

func (ea *ExecutorArg) ExecBaseArgs() []string

func (*ExecutorArg) RunArgsBase

func (ea *ExecutorArg) RunArgsBase(ctx context.Context) (*args.T, error)

RunArgsBase append extra args for podman

func (*ExecutorArg) WaitNotRunning

func (ea *ExecutorArg) WaitNotRunning(ctx context.Context) error

WaitNotRunning waits for the container to be not running: a wait with no --condition waits for it to be stopped, which every podman version does, podman 1 knowing no --condition and podman before 4.3 no --ignore. A container gone fails the wait, which the executor judges by inspect.

func (*ExecutorArg) WaitRemoved

func (ea *ExecutorArg) WaitRemoved(ctx context.Context) error

WaitRemoved waits for the container to be removed. podman 1 has no --condition: the wait fails there, and the executor inspects the container until it is gone.

type T

type T struct {
	rescontainerocibase.BT

	// RootlessUser, when set, is the unprivileged user podman runs the
	// container as, in their own store and their own user namespace.
	RootlessUser string `json:"rootless_user"`

	// RootlessGroup overrides the primary group of RootlessUser.
	RootlessGroup string `json:"rootless_group"`
}

func (*T) ApplyPG

func (t *T) ApplyPG(ctx context.Context) error

ApplyPG caps the container where podman places it.

A rootless container is placed by the systemd instance of its user, under the subtree systemd delegates to them, so the groups om caps are made there, owned by the user for their systemd to make the group of the container inside. The groups of the object and its namespace are made there too, with their cappings: a group is capped by the ones it is nested in, and those are only above it if they are made above it.

The cappings are written by om in files the user is not given, so they hold against the user as they do against the container.

func (*T) Configure

func (t *T) Configure() error

func (*T) DriverID

func (t *T) DriverID() driver.ID

func (*T) HostGID

func (t *T) HostGID(id uint32) (uint32, error)

HostGID implements resource.IDMapper: the host gid the gid id of the container runs as. The root group of the container is the group podman runs as, which rootless_group sets.

func (*T) HostUID

func (t *T) HostUID(id uint32) (uint32, error)

HostUID implements resource.IDMapper: the host uid the uid id of the container runs as.

func (*T) Manifest

func (t *T) Manifest() *manifest.T

Manifest exposes to the core the input expected by the driver.

func (*T) PGPath

func (t *T) PGPath() string

PGPath returns the cgroup the processes of the container run in: its process group, under the subtree delegated to its user for a rootless container, where its systemd instance places it. It is empty when the user of a rootless container is not known.

func (*T) ProvisionStart

func (t *T) ProvisionStart(ctx context.Context) error

ProvisionStart starts the container at the end of its provision on the placement leader only, as the oci base does, with the start of podman, which checks the rootless setup.

func (*T) ResetPG

func (t *T) ResetPG(ctx context.Context) error

ResetPG lifts the capping of the groups the container is placed in.

func (*T) RootlessIssues

func (t *T) RootlessIssues() []error

RootlessIssues returns what keeps the container from running rootless on this node, one error per issue, none for a container run by root.

It is exported for the podman task, which runs its command in a container of this driver and says the same in its own status.

func (*T) Start

func (t *T) Start(ctx context.Context) error

Start refuses to run a rootless container on a node that lacks what podman needs to, naming what it lacks.

func (*T) Status

func (t *T) Status(ctx context.Context) status.T

Status warns about what the node lacks for the container to run rootless: it is what an operator reading why the container is down needs to see.

Jump to

Keyboard shortcuts

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