crclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 15 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(ctx context.Context, obj client.Object, opts ...client.CreateOption) error

Create implements client.Client.

func (Client) Delete

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

Delete implements client.Client.

func (Client) DeleteAllOf

func (f Client) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error

DeleteAllOf implements client.Client.

func (Client) Get

func (f Client) Get(ctx context.Context, key client.ObjectKey, obj client.Object) error

Get implements client.Client.

func (Client) List

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

List implements client.Client.

func (Client) Patch

func (f Client) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error

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(ctx 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.StatusWriter

Status implements client.StatusClient.

func (Client) Update

func (f Client) Update(ctx context.Context, obj client.Object, opts ...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