package integration
import "github.com/containerd/cri/integration"
Index ¶
- func ConnectDaemons() error
- func ContainerConfig(name, image string, opts ...ContainerOpts) *runtime.ContainerConfig
- func Eventually(f CheckFunc, period, timeout time.Duration) error
- func KillProcess(name string) error
- func PidOf(name string) (int, error)
- func PodSandboxConfig(name, ns string, opts ...PodSandboxOpts) *runtime.PodSandboxConfig
- func Randomize(str string) string
- func WithHostNetwork(p *runtime.PodSandboxConfig)
- type CheckFunc
- type ContainerOpts
- func WithCommand(c string, args ...string) ContainerOpts
- func WithPidNamespace(mode runtime.NamespaceMode) ContainerOpts
- func WithResources(r *runtime.LinuxContainerResources) ContainerOpts
- func WithTestAnnotations() ContainerOpts
- func WithTestLabels() ContainerOpts
- type PodSandboxOpts
Functions ¶
func ConnectDaemons ¶
func ConnectDaemons() error
ConnectDaemons connect cri plugin and containerd, and initialize the clients.
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 ¶
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 KillProcess ¶
KillProcess kills the process by name. pkill is used.
func PidOf ¶
PidOf returns pid of a process by name.
func PodSandboxConfig ¶
func PodSandboxConfig(name, ns string, opts ...PodSandboxOpts) *runtime.PodSandboxConfig
PodSandboxConfig generates a pod sandbox config for test.
func Randomize ¶
Randomize adds uuid after a string.
func WithHostNetwork ¶
func WithHostNetwork(p *runtime.PodSandboxConfig)
Types ¶
type CheckFunc ¶
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 WithPidNamespace ¶
func WithPidNamespace(mode runtime.NamespaceMode) ContainerOpts
Add pid namespace mode.
func WithResources ¶
func WithResources(r *runtime.LinuxContainerResources) ContainerOpts
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 ¶
- Version
- v1.0.3
- Published
- Jun 11, 2018
- Platform
- js/wasm
- Imports
- 16 packages
- Last checked
- 4 hours ago –
Tools for package owners.