testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	mock.Mock

	StatusMock *StatusClient
}

Client is a mock for the controller-runtime dynamic client interface.

func NewClient

func NewClient() *Client

func (*Client) Create

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

func (*Client) Delete

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

func (*Client) DeleteAllOf

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

func (*Client) Get

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

func (*Client) List

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

func (*Client) Patch

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

func (*Client) RESTMapper

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

func (*Client) Scheme

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

func (*Client) Status

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

func (*Client) Update

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

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger implements logr.Logger and logs to testing.T to preserve the order of log lines in tests.

func NewLogger

func NewLogger(t *testing.T) *Logger

NewLogger returns a new Logger flushing to testing.T.

func (*Logger) Enabled

func (l *Logger) Enabled() bool

Enabled implements logr.Logger.Enabled

func (*Logger) Error

func (l *Logger) Error(err error, msg string, kvs ...interface{})

Error implements logr.Logger.Error

func (*Logger) Info

func (l *Logger) Info(msg string, kvs ...interface{})

Info implements logr.Logger.Info

func (*Logger) V

func (l *Logger) V(level int) logr.Logger

V implements logr.Logger.V

func (*Logger) WithName

func (l *Logger) WithName(name string) logr.Logger

WithName implements logr.Logger.WithName

func (*Logger) WithValues

func (l *Logger) WithValues(kvs ...interface{}) logr.Logger

WithValues implements logr.Logger.WithValues

type StatusClient

type StatusClient struct {
	mock.Mock
}

func (*StatusClient) Patch

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

func (*StatusClient) Update

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

Jump to

Keyboard shortcuts

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