containerdtest

package
v0.33.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package containerdtest is a poor-man's dockertest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Container containerd.Container
	// contains filtered or unexported fields
}

Container represents a container belonging to a containerd Pool.

func (*Container) Status

func (c *Container) Status() containerd.ProcessStatus

Status returns the container (task) status or containerd.Unknown.

type Pool

type Pool struct {
	Namespace string
	Client    *containerd.Client
}

Pool represents a containerd client working on a specific (containerd) namespace.

func NewPool

func NewPool(endpoint string, namespace string) (*Pool, error)

NewPool creates a new containerd client that works in the specified containerd namespace and connects to the specified API path.

func (*Pool) Purge

func (pool *Pool) Purge(c *Container)

Purge (delete) the specified container from the pool, including its task and snapshot, if any.

func (*Pool) PurgeID

func (pool *Pool) PurgeID(id string)

PurgeID purges the specified container (including task and snapshot), identified by its ID/name.

func (*Pool) Run

func (pool *Pool) Run(id string, ref string, run bool, args []string, opts ...containerd.NewContainerOpts) (*Container, error)

Run creates a new container using the specified image ref and runs it using the specified args. If run is false, the container is then paused.

Jump to

Keyboard shortcuts

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