test

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNamespaceOrDie

func CreateNamespaceOrDie(namespaces corev1.NamespaceInterface, stem string) string

CreateNamespaceOrDie creates a new unique namespace from stem

func CreateObject

func CreateObject(tContext TestContext, obj runtime.Object, async bool, delay time.Duration) runtime.Object

Creates the object

func DeleteInNs

func DeleteInNs(tContext TestContext, obj runtime.Object, async bool)

DeletInNs the object

func DeleteObject

func DeleteObject(tContext TestContext, obj runtime.Object, async bool)

DeleteObject deletes an object

func GetClientsetOrDie

func GetClientsetOrDie(restCfg *rest.Config) *kubernetes.Clientset

GetClientsetOrDie gets a Kube clientset for KUBECONFIG

func GetObject

func GetObject(tContext TestContext, obj runtime.Object) func() runtime.Object

GetObject gets the object from the store

func GetState

func GetState(tContext TestContext, comp *v1alpha1.Composable) func() string

GetState gets the object status from the store

func GetUnstructuredObject

func GetUnstructuredObject(tContext TestContext, namespacedname types.NamespacedName, obj *unstructured.Unstructured) func() error

GetObject gets the object from the store

func LoadCompasable

func LoadCompasable(filename string) v1alpha1.Composable

LoadService loads the YAML spec into obj

func LoadObject

func LoadObject(filename string, obj runtime.Object) runtime.Object

LoadObject loads the YAML spec into obj

func PostInNs

func PostInNs(tContext TestContext, obj runtime.Object, async bool, delay time.Duration) runtime.Object

PostInNs the object

func SetupKubeOrDie

func SetupKubeOrDie(restCfg *rest.Config, stem string) string

SetupKubeOrDie setups Kube for testing

func StartTestManager

func StartTestManager(mgr manager.Manager) chan struct{}

StartTestManager starts the manager

func UpdateObject

func UpdateObject(tContext TestContext, obj runtime.Object, async bool, delay time.Duration) runtime.Object

Updates the given object

Types

type TestContext

type TestContext interface {
	context.Context

	// The dynamic client
	Client() client.Client

	// The object namespace being reconciled
	Namespace() string
}

TestContext represents a context for test operations

func NewTestContext

func NewTestContext(client client.Client, namespace string) TestContext

New creates a reconcile context

Jump to

Keyboard shortcuts

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