package integration

import "github.com/containerd/cri/integration"

Index

Functions

func ContainerConfig

func ContainerConfig(name, image string, opts ...ContainerOpts) *runtime.ContainerConfig

ContainerConfig creates a container config given a name and image name and additional container config options

func Eventually

func Eventually(f CheckFunc, period, timeout time.Duration) error

Eventually waits for f to return true, it checks every period, and returns error if timeout exceeds. If f returns error, Eventually will return the same error immediately.

func PodSandboxConfig

func PodSandboxConfig(name, ns string, opts ...PodSandboxOpts) *runtime.PodSandboxConfig

PodSandboxConfig generates a pod sandbox config for test.

func Randomize

func Randomize(str string) string

Randomize adds uuid after a string.

Types

type CheckFunc

type CheckFunc func() (bool, error)

CheckFunc is the function used to check a condition is true/false.

type ContainerOpts

type ContainerOpts func(*runtime.ContainerConfig)

ContainerOpts to set any specific attribute like labels, annotations, metadata etc

func WithCommand

func WithCommand(c string, args ...string) ContainerOpts

Add container command.

func WithResources

Add container resource limits.

func WithTestAnnotations

func WithTestAnnotations() ContainerOpts

func WithTestLabels

func WithTestLabels() ContainerOpts

type PodSandboxOpts

type PodSandboxOpts func(*runtime.PodSandboxConfig)

Opts sets specific information in pod sandbox config.

Source Files

test_utils.go

Version
v1.0.0-alpha.1
Published
Oct 31, 2017
Platform
js/wasm
Imports
10 packages
Last checked
4 hours ago

Tools for package owners.