controllertest

package
v0.0.0-...-d41c5fe Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Verb        ActionVerb
	Subresource string
	Object      runtime.Object
	Name        string
	Namespace   string
	Visited     bool
}

func (Action) Resource

func (a Action) Resource() string

type ActionVerb

type ActionVerb string
const (
	ActionUpdate ActionVerb = "update"
	ActionCreate ActionVerb = "create"
	ActionDelete ActionVerb = "delete"
)

func (ActionVerb) String

func (a ActionVerb) String() string

type GenericTestRunner

type GenericTestRunner[T runtime.Object] struct {
	*TestRunner
}

func NewGenericTestRunner

func NewGenericTestRunner[T runtime.Object]() *GenericTestRunner[T]

func (*GenericTestRunner[T]) Finalize

func (r *GenericTestRunner[T]) Finalize(c controllerutil.GenericReconciler[T], v T) error

func (*GenericTestRunner[T]) Reconcile

func (r *GenericTestRunner[T]) Reconcile(c controllerutil.GenericReconciler[T], v T) error

type TestRunner

type TestRunner struct {
	Client                    *testingclient.Set
	CoreClient                *corefake.Clientset
	Factory                   *client.InformerFactory
	CoreSharedInformerFactory kubeinformers.SharedInformerFactory
	Actions                   []*Action
}

func NewTestRunner

func NewTestRunner() *TestRunner

func (*TestRunner) AssertAction

func (r *TestRunner) AssertAction(t *testing.T, e Action) bool

func (*TestRunner) AssertCreateAction

func (r *TestRunner) AssertCreateAction(t *testing.T, obj runtime.Object) bool

func (*TestRunner) AssertDeleteAction

func (r *TestRunner) AssertDeleteAction(t *testing.T, obj runtime.Object) bool

func (*TestRunner) AssertNoUnexpectedAction

func (r *TestRunner) AssertNoUnexpectedAction(t *testing.T)

func (*TestRunner) AssertUpdateAction

func (r *TestRunner) AssertUpdateAction(t *testing.T, subresource string, obj runtime.Object) bool

func (*TestRunner) Finalize

func (*TestRunner) Reconcile

func (*TestRunner) RegisterFixture

func (r *TestRunner) RegisterFixture(objs ...runtime.Object)

Jump to

Keyboard shortcuts

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