podman

package
v0.0.0-...-3511abf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PodmanClient

type PodmanClient struct {
	// contains filtered or unexported fields
}

PodmanClient implements ContainerRuntime.

func New

func New(opts options.Options) (*PodmanClient, error)

New returns a new podman client, which launches and tracks containers.

func (*PodmanClient) Close

func (s *PodmanClient) Close() error

Close the client, killing all running containers and removing our scratch space.

func (*PodmanClient) CreateContainer

func (s *PodmanClient) CreateContainer(
	ctx context.Context,
	id cproto.ID,
	req cproto.RunSpec,
	p events.Publisher[docker.Event],
) (string, error)

CreateContainer implements container.ContainerRuntime.

func (*PodmanClient) ListRunningContainers

func (s *PodmanClient) ListRunningContainers(
	ctx context.Context,
	fs filters.Args,
) (map[cproto.ID]types.Container, error)

ListRunningContainers implements container.ContainerRuntime.

func (*PodmanClient) PullImage

func (s *PodmanClient) PullImage(
	ctx context.Context,
	req docker.PullImage,
	p events.Publisher[docker.Event],
) (err error)

PullImage implements container.ContainerRuntime.

func (*PodmanClient) ReattachContainer

func (s *PodmanClient) ReattachContainer(
	ctx context.Context,
	reattachID cproto.ID,
) (*docker.Container, *aproto.ExitCode, error)

ReattachContainer implements container.ContainerRuntime. TODO(DET-9082): Ensure orphaned processes are cleaned up on reattach.

func (*PodmanClient) RemoveContainer

func (s *PodmanClient) RemoveContainer(ctx context.Context, id string, force bool) error

RemoveContainer implements container.ContainerRuntime.

func (*PodmanClient) RunContainer

func (s *PodmanClient) RunContainer(
	ctx context.Context,
	waitCtx context.Context,
	id string,
	p events.Publisher[docker.Event],
) (*docker.Container, error)

RunContainer implements container.ContainerRuntime. nolint: golint,maintidx // Both contexts can't both be first / TODO refactor.

func (*PodmanClient) SignalContainer

func (s *PodmanClient) SignalContainer(
	ctx context.Context,
	id string,
	sig syscall.Signal,
) error

SignalContainer implements container.ContainerRuntime.

type PodmanContainer

type PodmanContainer struct {
	PID     int            `json:"pid"`
	Req     cproto.RunSpec `json:"req"`
	TmpDir  string         `json:"tmp_dir"`
	Proc    *os.Process    `json:"-"`
	Started atomic.Bool    `json:"started"`
}

PodmanContainer captures the state of a container.

Jump to

Keyboard shortcuts

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