Documentation
¶
Index ¶
- Constants
- Variables
- func RunContainerdFailedContainer(ctx context.Context, t *testing.T)
- func RunDockerFailedContainer(ctx context.Context, t *testing.T)
- type Container
- func NewContainer(runtime types.RuntimeName, name, cmd string, options ...Option) (Container, error)
- func NewContainerdContainer(name, cmd string, options ...Option) Container
- func NewDockerContainer(name, cmd string, options ...Option) Container
- func NewK8sContainer(name, cmd string, options ...Option) Container
- type ContainerdContainer
- func (c *ContainerdContainer) DisplayName() string
- func (c *ContainerdContainer) ID() string
- func (c *ContainerdContainer) IP() 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) DisplayName() string
- func (c *DockerContainer) ID() string
- func (c *DockerContainer) IP() 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 K8sContainer
- func (c *K8sContainer) DisplayName() string
- func (c *K8sContainer) ID() string
- func (c *K8sContainer) IP() string
- func (c *K8sContainer) Pid() int
- func (c *K8sContainer) PortBindings() nat.PortMap
- func (c *K8sContainer) Run(t *testing.T)
- func (c *K8sContainer) Running() bool
- func (c *K8sContainer) Start(t *testing.T)
- func (c *K8sContainer) Stop(t *testing.T)
- type Option
- func WithBindMounts(mounts []string) Option
- func WithContext(ctx context.Context) Option
- func WithExpectStartError() Option
- func WithForceDelete() Option
- func WithImage(image string) Option
- func WithImageTag(tag string) Option
- func WithLimits(limits map[string]string) Option
- func WithNamespace(namespace string) Option
- func WithPortBindings(portBindings nat.PortMap) Option
- func WithPrivileged() Option
- func WithSeccompProfile(profile string) Option
- func WithWaitOrOomKilled() 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 { DisplayName() string Run(t *testing.T) Start(t *testing.T) Stop(t *testing.T) ID() string IP() 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
func NewK8sContainer ¶ added in v0.30.0
type ContainerdContainer ¶ added in v0.20.0
type ContainerdContainer struct {
// contains filtered or unexported fields
}
func (*ContainerdContainer) DisplayName ¶ added in v0.28.0
func (c *ContainerdContainer) DisplayName() string
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) DisplayName ¶ added in v0.28.0
func (c *DockerContainer) DisplayName() string
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 K8sContainer ¶ added in v0.30.0
type K8sContainer struct {
// contains filtered or unexported fields
}
func (*K8sContainer) DisplayName ¶ added in v0.30.0
func (c *K8sContainer) DisplayName() string
func (*K8sContainer) PortBindings ¶ added in v0.30.0
func (*K8sContainer) Run ¶ added in v0.30.0
func (c *K8sContainer) Run(t *testing.T)
func (*K8sContainer) Start ¶ added in v0.30.0
func (c *K8sContainer) Start(t *testing.T)
func (*K8sContainer) Stop ¶ added in v0.30.0
func (c *K8sContainer) Stop(t *testing.T)
type Option ¶
type Option func(*containerOptions)
func WithBindMounts ¶ added in v0.30.0
func WithContext ¶ added in v0.20.0
func WithExpectStartError ¶ added in v0.30.0
func WithExpectStartError() Option
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 WithLimits ¶ added in v0.31.0
WithLimits sets the resource limits of the container
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 WithPrivileged ¶ added in v0.30.0
func WithPrivileged() Option
func WithSeccompProfile ¶
func WithWaitOrOomKilled ¶ added in v0.31.0
func WithWaitOrOomKilled() Option
func WithoutLogs ¶
func WithoutLogs() Option
func WithoutWait ¶
func WithoutWait() Option
Click to show internal directories.
Click to hide internal directories.