crclient

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Objects       map[shared.StorageKey]runtime.Object
	ErrorInjector shared.ErrorInjector
}

Client implements a controller runtime client Objects mocks k8s resources ErrorInjector is used to force errors from controller for test

func NewFakeClient

func NewFakeClient(objectMap map[shared.StorageKey]runtime.Object, errorInjector shared.ErrorInjector) *Client

NewFakeClient creates a new client

func NewFakeClientNoInjector

func NewFakeClientNoInjector(objectMap map[shared.StorageKey]runtime.Object) *Client

NewFakeClientNoInjector creates a new client without an error injector

func (Client) Clear

func (f Client) Clear()

Clear cleans objects

func (Client) Create

func (f Client) Create(_ context.Context, obj client.Object, _ ...client.CreateOption) error

Create implements client.Client.

func (Client) Delete

func (f Client) Delete(_ context.Context, obj client.Object, opts ...client.DeleteOption) error

Delete implements client.Client.

func (Client) DeleteAllOf

func (f Client) DeleteAllOf(_ context.Context, _ client.Object, _ ...client.DeleteAllOfOption) error

DeleteAllOf implements client.Client.

func (Client) Get

Get implements client.Client.

func (Client) GroupVersionKindFor added in v1.3.0

func (f Client) GroupVersionKindFor(_ runtime.Object) (schema.GroupVersionKind, error)

GroupVersionKindFor returns the GroupVersionKind for the given object.

func (Client) IsObjectNamespaced added in v1.3.0

func (f Client) IsObjectNamespaced(_ runtime.Object) (bool, error)

IsObjectNamespaced returns true if the GroupVersionKind of the object is namespaced.

func (Client) List

func (f Client) List(ctx context.Context, list client.ObjectList, _ ...client.ListOption) error

List implements client.Client.

func (Client) Patch

Patch implements client.Client.

func (Client) RESTMapper

func (f Client) RESTMapper() meta.RESTMapper

RESTMapper returns the scheme this client is using.

func (Client) Scheme

func (f Client) Scheme() *runtime.Scheme

Scheme returns the scheme this client is using.

func (Client) SetDeletionTimeStamp

func (f Client) SetDeletionTimeStamp(_ context.Context, obj client.Object) error

SetDeletionTimeStamp so that reconcile can go into deletion part of code

func (Client) Status

func (f Client) Status() client.SubResourceWriter

Status implements client.StatusClient.

func (Client) SubResource added in v1.3.0

func (f Client) SubResource(subResource string) client.SubResourceClient

SubResource returns a subresource with the name specified in subResource

func (Client) Update

func (f Client) Update(_ context.Context, obj client.Object, _ ...client.UpdateOption) error

Update implements client.StatusWriter.

Jump to

Keyboard shortcuts

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