integration

package
v1.3.0-k3s.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRIConfig added in v1.0.4

func CRIConfig() (*criconfig.Config, error)

CRIConfig gets current cri config from containerd.

func ConnectDaemons

func ConnectDaemons() error

ConnectDaemons connect cri plugin and containerd, and initialize the clients.

func Consistently

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

Consistently makes sure that f consistently returns true without error before timeout exceeds. If f returns error, Consistently will return the same error immediately.

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 KillPid

func KillPid(pid int) error

KillPid kills the process by pid. kill is used.

func KillProcess

func KillProcess(name string) error

KillProcess kills the process by name. pkill is used.

func PidOf

func PidOf(name string) (int, error)

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

func Randomize(str string) string

Randomize adds uuid after a string.

func RawRuntimeClient

func RawRuntimeClient() (runtime.RuntimeServiceClient, error)

RawRuntimeClient returns a raw grpc runtime service client.

func RestartContainerd

func RestartContainerd(t *testing.T)

func SandboxInfo

func SandboxInfo(id string) (*runtime.PodSandboxStatus, *server.SandboxInfo, error)

SandboxInfo gets sandbox info.

func WithHostNetwork

func WithHostNetwork(p *runtime.PodSandboxConfig)

Set host network.

func WithHostPid

func WithHostPid(p *runtime.PodSandboxConfig)

Set host pid.

func WithPodPid

func WithPodPid(p *runtime.PodSandboxConfig)

Set pod pid.

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(cmd string, args ...string) ContainerOpts

Add container command.

func WithLogPath added in v1.0.4

func WithLogPath(path string) ContainerOpts

Add container log path.

func WithPidNamespace

func WithPidNamespace(mode runtime.NamespaceMode) ContainerOpts

Add pid namespace mode.

func WithResources

Add container resource limits.

func WithSupplementalGroups

func WithSupplementalGroups(gids []int64) ContainerOpts

WithSupplementalGroups adds supplemental groups.

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.

func WithPodHostname

func WithPodHostname(hostname string) PodSandboxOpts

Add pod hostname.

func WithPodLogDirectory added in v1.0.4

func WithPodLogDirectory(dir string) PodSandboxOpts

Add pod log directory.

Jump to

Keyboard shortcuts

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