Documentation ¶
Index ¶
- Constants
- Variables
- func RunContainerdFailedContainer(ctx context.Context, t *testing.T)
- func RunDockerFailedContainer(ctx context.Context, t *testing.T)
- type Container
- type ContainerdContainer
- func (c *ContainerdContainer) ID() string
- func (c *ContainerdContainer) Pid() int
- func (c *ContainerdContainer) PortBindings() nat.PortMap
- func (c *ContainerdContainer) Run(t *testing.T)
- func (c *ContainerdContainer) Running() bool
- func (c *ContainerdContainer) Start(t *testing.T)
- func (c *ContainerdContainer) Stop(t *testing.T)
- type DockerContainer
- func (c *DockerContainer) ID() string
- func (c *DockerContainer) Pid() int
- func (c *DockerContainer) PortBindings() nat.PortMap
- func (d *DockerContainer) Run(t *testing.T)
- func (c *DockerContainer) Running() bool
- func (d *DockerContainer) Start(t *testing.T)
- func (d *DockerContainer) Stop(t *testing.T)
- type Option
- func WithContext(ctx context.Context) Option
- func WithForceDelete() Option
- func WithImage(image string) Option
- func WithImageTag(tag string) Option
- func WithNamespace(namespace string) Option
- func WithPortBindings(portBindings nat.PortMap) Option
- func WithSeccompProfile(profile string) Option
- func WithoutLogs() Option
- func WithoutWait() Option
Constants ¶
View Source
const ( DefaultContainerImage = "docker.io/library/busybox" DefaultContainerImageTag = "latest" )
Variables ¶
View Source
var SupportedContainerRuntimes = []types.RuntimeName{ types.RuntimeNameDocker, types.RuntimeNameContainerd, }
Functions ¶
func RunContainerdFailedContainer ¶ added in v0.18.0
Types ¶
type Container ¶ added in v0.20.0
type Container interface { Run(t *testing.T) Start(t *testing.T) Stop(t *testing.T) ID() string Pid() int Running() bool PortBindings() nat.PortMap }
func NewContainer ¶ added in v0.20.0
func NewContainerdContainer ¶ added in v0.20.0
func NewDockerContainer ¶ added in v0.20.0
type ContainerdContainer ¶ added in v0.20.0
type ContainerdContainer struct {
// contains filtered or unexported fields
}
func (*ContainerdContainer) PortBindings ¶ added in v0.25.0
func (*ContainerdContainer) Run ¶ added in v0.20.0
func (c *ContainerdContainer) Run(t *testing.T)
func (*ContainerdContainer) Start ¶ added in v0.20.0
func (c *ContainerdContainer) Start(t *testing.T)
func (*ContainerdContainer) Stop ¶ added in v0.20.0
func (c *ContainerdContainer) Stop(t *testing.T)
type DockerContainer ¶ added in v0.20.0
type DockerContainer struct {
// contains filtered or unexported fields
}
func (*DockerContainer) PortBindings ¶ added in v0.25.0
func (*DockerContainer) Run ¶ added in v0.20.0
func (d *DockerContainer) Run(t *testing.T)
func (*DockerContainer) Start ¶ added in v0.20.0
func (d *DockerContainer) Start(t *testing.T)
func (*DockerContainer) Stop ¶ added in v0.20.0
func (d *DockerContainer) Stop(t *testing.T)
type Option ¶
type Option func(*containerOptions)
func WithContext ¶ added in v0.20.0
func WithForceDelete ¶ added in v0.20.0
func WithForceDelete() Option
WithForceDelete is mostly used for debugging purposes, when a container fails to be deleted and we want to force it.
func WithImageTag ¶ added in v0.18.0
func WithNamespace ¶ added in v0.20.0
WithNamespace sets the namespace of the container runtime
func WithPortBindings ¶ added in v0.25.0
WithPortBindings sets the exposed ports of the container
func WithSeccompProfile ¶
func WithoutLogs ¶
func WithoutLogs() Option
func WithoutWait ¶
func WithoutWait() Option
Click to show internal directories.
Click to hide internal directories.