testutil

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigMap

func NewConfigMap() *corev1.ConfigMap

func NewSecret

func NewSecret() *corev1.Secret

func NewTestSchemeWithCoreV1

func NewTestSchemeWithCoreV1() *runtime.Scheme

func NewTestSchemeWithCoreV1Alpha1

func NewTestSchemeWithCoreV1Alpha1() *runtime.Scheme

func NewTestSchemeWithCoreV1AppsV1

func NewTestSchemeWithCoreV1AppsV1() *runtime.Scheme

Types

type CtrlClient

type CtrlClient struct {
	mock.Mock

	StatusMock *CtrlStatusClient
}

CtrlClient is a mock for the controller-runtime client interface.

func NewClient

func NewClient() *CtrlClient

func (*CtrlClient) Create

func (c *CtrlClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error

func (*CtrlClient) Delete

func (c *CtrlClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error

func (*CtrlClient) DeleteAllOf

func (c *CtrlClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error

func (*CtrlClient) Get

func (c *CtrlClient) Get(
	ctx context.Context, key types.NamespacedName, obj client.Object, opts ...client.GetOption,
) error

func (*CtrlClient) GroupVersionKindFor

func (c *CtrlClient) GroupVersionKindFor(_ runtime.Object) (schema.GroupVersionKind, error)

func (*CtrlClient) IsObjectNamespaced

func (c *CtrlClient) IsObjectNamespaced(_ runtime.Object) (bool, error)

func (*CtrlClient) List

func (c *CtrlClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error

func (*CtrlClient) Patch

func (c *CtrlClient) Patch(
	ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption,
) error

func (*CtrlClient) RESTMapper

func (c *CtrlClient) RESTMapper() meta.RESTMapper

func (*CtrlClient) Scheme

func (c *CtrlClient) Scheme() *runtime.Scheme

func (*CtrlClient) Status

func (c *CtrlClient) Status() client.StatusWriter

func (*CtrlClient) SubResource

func (c *CtrlClient) SubResource(string) client.SubResourceClient

func (*CtrlClient) Update

func (c *CtrlClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type CtrlStatusClient

type CtrlStatusClient struct {
	mock.Mock
}

func (*CtrlStatusClient) Create

func (c *CtrlStatusClient) Create(
	ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption,
) error

func (*CtrlStatusClient) Patch

func (*CtrlStatusClient) Update

type DynamicClient

type DynamicClient struct {
	mock.Mock
}

func NewDynamicClient

func NewDynamicClient() *DynamicClient

func (*DynamicClient) Resource

type DynamicClientNamespaceableResourceInterface

type DynamicClientNamespaceableResourceInterface struct {
	mock.Mock
}

func (*DynamicClientNamespaceableResourceInterface) Apply

func (*DynamicClientNamespaceableResourceInterface) ApplyStatus

func (*DynamicClientNamespaceableResourceInterface) Create

func (*DynamicClientNamespaceableResourceInterface) Delete

func (dc *DynamicClientNamespaceableResourceInterface) Delete(
	ctx context.Context, name string,
	options metav1.DeleteOptions, subresources ...string,
) error

func (*DynamicClientNamespaceableResourceInterface) DeleteCollection

func (dc *DynamicClientNamespaceableResourceInterface) DeleteCollection(
	ctx context.Context, options metav1.DeleteOptions,
	listOptions metav1.ListOptions,
) error

func (*DynamicClientNamespaceableResourceInterface) Get

func (*DynamicClientNamespaceableResourceInterface) List

func (*DynamicClientNamespaceableResourceInterface) Namespace

func (*DynamicClientNamespaceableResourceInterface) Patch

func (*DynamicClientNamespaceableResourceInterface) Update

func (*DynamicClientNamespaceableResourceInterface) UpdateStatus

func (*DynamicClientNamespaceableResourceInterface) Watch

type DynamicClientResourceInterface

type DynamicClientResourceInterface struct {
	mock.Mock
}

func (*DynamicClientResourceInterface) Apply

func (*DynamicClientResourceInterface) ApplyStatus

func (*DynamicClientResourceInterface) Create

func (*DynamicClientResourceInterface) Delete

func (dc *DynamicClientResourceInterface) Delete(
	ctx context.Context, name string,
	options metav1.DeleteOptions, subresources ...string,
) error

func (*DynamicClientResourceInterface) DeleteCollection

func (dc *DynamicClientResourceInterface) DeleteCollection(
	ctx context.Context, options metav1.DeleteOptions,
	listOptions metav1.ListOptions,
) error

func (*DynamicClientResourceInterface) Get

func (dc *DynamicClientResourceInterface) Get(
	ctx context.Context, name string,
	options metav1.GetOptions, subresources ...string,
) (*unstructured.Unstructured, error)

func (*DynamicClientResourceInterface) List

func (*DynamicClientResourceInterface) Patch

func (dc *DynamicClientResourceInterface) Patch(
	ctx context.Context, name string,
	pt types.PatchType, data []byte,
	options metav1.PatchOptions, subresources ...string,
) (*unstructured.Unstructured, error)

func (*DynamicClientResourceInterface) Update

func (*DynamicClientResourceInterface) UpdateStatus

func (*DynamicClientResourceInterface) Watch

type InMemoryRegistry

type InMemoryRegistry struct {
	RoundTripper http.RoundTripper
	Handler      http.Handler
	CraneOpt     crane.Option
}

func NewInMemoryRegistry

func NewInMemoryRegistry() *InMemoryRegistry

type RateLimitingQueue

type RateLimitingQueue struct {
	mock.Mock
}

func (*RateLimitingQueue) Add

func (q *RateLimitingQueue) Add(item any)

func (*RateLimitingQueue) AddAfter

func (q *RateLimitingQueue) AddAfter(item any, duration time.Duration)

func (*RateLimitingQueue) AddRateLimited

func (q *RateLimitingQueue) AddRateLimited(item any)

func (*RateLimitingQueue) Done

func (q *RateLimitingQueue) Done(item any)

func (*RateLimitingQueue) Forget

func (q *RateLimitingQueue) Forget(item any)

func (*RateLimitingQueue) Get

func (q *RateLimitingQueue) Get() (item any, shutdown bool)

func (*RateLimitingQueue) Len

func (q *RateLimitingQueue) Len() int

func (*RateLimitingQueue) NumRequeues

func (q *RateLimitingQueue) NumRequeues(item any) int

func (*RateLimitingQueue) ShutDown

func (q *RateLimitingQueue) ShutDown()

func (*RateLimitingQueue) ShutDownWithDrain

func (q *RateLimitingQueue) ShutDownWithDrain()

func (*RateLimitingQueue) ShuttingDown

func (q *RateLimitingQueue) ShuttingDown() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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