fake

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 18 Imported by: 254

Documentation

Overview

Package fake provides a fake client for testing.

Deprecated: please use pkg/envtest for testing. This package will be dropped before the v1.0.0 release.

An fake client is backed by its simple object store indexed by GroupVersionResource. You can create a fake client with optional objects.

client := NewFakeClient(initObjs...) // initObjs is a slice of runtime.Object

You can invoke the methods defined in the Client interface.

When it doubt, it's almost always better not to use this package and instead use envtest.Environment with a real client and API server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeClient

func NewFakeClient(initObjs ...runtime.Object) client.Client

NewFakeClient creates a new fake client for testing. You can choose to initialize it with a slice of runtime.Object. Deprecated: use NewFakeClientWithScheme. You should always be passing an explicit Scheme.

func NewFakeClientWithScheme added in v0.1.8

func NewFakeClientWithScheme(clientScheme *runtime.Scheme, initObjs ...runtime.Object) client.Client

NewFakeClientWithScheme creates a new fake client with the given scheme for testing. You can choose to initialize it with a slice of runtime.Object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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