package testing

import "k8s.io/kubernetes/pkg/kubelet/runtimeclass/testing"

Index

Constants

const (
	// SandboxRuntimeClass is a valid RuntimeClass pre-populated in the populated dynamic client.
	SandboxRuntimeClass = "sandbox"
	// SandboxRuntimeHandler is the handler associated with the SandboxRuntimeClass.
	SandboxRuntimeHandler = "kata-containers"

	// EmptyRuntimeClass is a valid RuntimeClass without a handler pre-populated in the populated dynamic client.
	EmptyRuntimeClass = "native"
	// InvalidRuntimeClass is an invalid RuntimeClass pre-populated in the populated dynamic client.
	InvalidRuntimeClass = "foo"
)

Functions

func NewPopulatedDynamicClient

func NewPopulatedDynamicClient() dynamic.Interface

NewPopulatedDynamicClient creates a dynamic client for use with the runtimeclass.Manager, and populates it with a few test RuntimeClass objects.

func NewUnstructuredRuntimeClass

func NewUnstructuredRuntimeClass(name, handler string) *unstructured.Unstructured

NewUnstructuredRuntimeClass is a helper to generate an unstructured RuntimeClass resource with the given name & handler.

func StartManagerSync

func StartManagerSync(t *testing.T, m *runtimeclass.Manager) func()

StartManagerSync runs the manager, and waits for startup by polling for the expected "native" RuntimeClass to be populated. Returns a function to stop the manager, which should be called with a defer:

defer StartManagerSync(t, m)()

Any errors are considered fatal to the test.

Source Files

fake_manager.go

Version
v1.12.7
Published
Mar 22, 2019
Platform
js/wasm
Imports
11 packages
Last checked
6 seconds ago

Tools for package owners.