Documentation
¶
Index ¶
- Variables
- func IsGenuine() bool
- func New() resource.Driver
- type ExecutorArg
- func (ea *ExecutorArg) Credential() (*rescontainerocibase.Credential, error)
- func (ea *ExecutorArg) ExecBaseArgs() []string
- func (ea *ExecutorArg) RunArgsBase(ctx context.Context) (*args.T, error)
- func (ea *ExecutorArg) WaitNotRunning(ctx context.Context) error
- func (ea *ExecutorArg) WaitRemoved(ctx context.Context) error
- type T
- func (t *T) ApplyPG(ctx context.Context) error
- func (t *T) Configure() error
- func (t *T) DriverID() driver.ID
- func (t *T) HostGID(id uint32) (uint32, error)
- func (t *T) HostUID(id uint32) (uint32, error)
- func (t *T) Manifest() *manifest.T
- func (t *T) PGPath() string
- func (t *T) ProvisionStart(ctx context.Context) error
- func (t *T) ResetPG(ctx context.Context) error
- func (t *T) RootlessIssues() []error
- func (t *T) Start(ctx context.Context) error
- func (t *T) Status(ctx context.Context) status.T
Constants ¶
This section is empty.
Variables ¶
var (
DrvID = driver.NewID(driver.GroupContainer, "podman")
)
Functions ¶
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 ¶
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 ¶
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) HostGID ¶
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 ¶
HostUID implements resource.IDMapper: the host uid the uid id of the container runs as.
func (*T) PGPath ¶
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 ¶
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) RootlessIssues ¶
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.