test

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNamespaceOrDie

func CreateNamespaceOrDie(ctx context.Context, tContext TestContext, name string) error

CreateNamespaceOrDie creates a new namespace

func CreateObject

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

Creates the object

func DeleteInNs

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

DeletInNs the object

func DeleteObject

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

DeleteObject deletes an object

func GetObject

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

GetObject gets the object from the store

func GetStatusMessage

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

GetStatusMessage returns the status message of a Composable object

func GetStatusState

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

GetStatusState returns the status state of a Composable object

func GetUnstructuredObject

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

GetObject gets the object from the store

func LoadComposable

func LoadComposable(filename string) v1alpha1.Composable

LoadComposable loads the YAML spec into Composable object

func LoadObject

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

LoadObject loads the YAML spec into obj

func PostInNs

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

PostInNs the object

func UpdateObject

func UpdateObject(tContext TestContext, obj client.Object, async bool, delay time.Duration) client.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