fake

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeMetadataClient

type FakeMetadataClient struct {
	testing.Fake
	// contains filtered or unexported fields
}

FakeMetadataClient implements clientset.Interface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func NewSimpleMetadataClient

func NewSimpleMetadataClient(scheme *runtime.Scheme, objects ...runtime.Object) *FakeMetadataClient

NewSimpleMetadataClient creates a new client that will use the provided scheme and respond with the provided objects when requests are made. It will track actions made to the client which can be checked with GetActions().

func (*FakeMetadataClient) Resource

Resource returns an interface for accessing the provided resource.

type MetadataClient

type MetadataClient interface {
	metadata.Getter
	CreateFake(obj *metav1.PartialObjectMetadata, opts metav1.CreateOptions, subresources ...string) (*metav1.PartialObjectMetadata, error)
	UpdateFake(obj *metav1.PartialObjectMetadata, opts metav1.UpdateOptions, subresources ...string) (*metav1.PartialObjectMetadata, error)
}

MetadataClient assists in creating fake objects for use when testing, since metadata.Getter does not expose create

Jump to

Keyboard shortcuts

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