fake

package
v1.11.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2018 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package fake provides a fake client interface to arbitrary Kubernetes APIs that exposes common high level operations and exposes common metadata.

Package fake provides a fake client interface to arbitrary Kubernetes APIs that exposes common high level operations and exposes common metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeClient

type FakeClient struct {
	GroupVersion schema.GroupVersion

	*testing.Fake
}

FakeClient is a fake implementation of dynamic.Interface.

func (*FakeClient) GetRateLimiter

func (c *FakeClient) GetRateLimiter() flowcontrol.RateLimiter

GetRateLimiter returns the rate limiter for this client.

func (*FakeClient) ParameterCodec

func (c *FakeClient) ParameterCodec(parameterCodec runtime.ParameterCodec) dynamic.Interface

ParameterCodec returns a client with the provided parameter codec.

func (*FakeClient) Resource

func (c *FakeClient) Resource(resource *metav1.APIResource, namespace string) dynamic.ResourceInterface

Resource returns an API interface to the specified resource for this client's group and version. If resource is not a namespaced resource, then namespace is ignored. The ResourceClient inherits the parameter codec of this client

type FakeClientPool

type FakeClientPool struct {
	testing.Fake
}

FakeClientPool provides a fake implementation of dynamic.ClientPool. It assumes resource GroupVersions are the same as their corresponding kind GroupVersions.

func (*FakeClientPool) ClientForGroupVersionKind

func (p *FakeClientPool) ClientForGroupVersionKind(kind schema.GroupVersionKind) (dynamic.Interface, error)

ClientForGroupVersionKind returns a client configured for the specified groupVersionKind. Kind may be empty.

func (*FakeClientPool) ClientForGroupVersionResource

func (p *FakeClientPool) ClientForGroupVersionResource(resource schema.GroupVersionResource) (dynamic.Interface, error)

ClientForGroupVersionKind returns a client configured for the specified groupVersionResource. Resource may be empty.

type FakeDynamicClient added in v1.11.0

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

Clientset 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 NewSimpleDynamicClient added in v1.11.0

func NewSimpleDynamicClient(scheme *runtime.Scheme, objects ...runtime.Object) *FakeDynamicClient

func (*FakeDynamicClient) ClusterSubresource

func (c *FakeDynamicClient) ClusterSubresource(resource schema.GroupVersionResource, subresource string) dynamic.DynamicResourceInterface

Deprecated, this isn't how we want to do it

func (*FakeDynamicClient) NamespacedSubresource

func (c *FakeDynamicClient) NamespacedSubresource(resource schema.GroupVersionResource, subresource, namespace string) dynamic.DynamicResourceInterface

Deprecated, this isn't how we want to do it

func (*FakeDynamicClient) Resource added in v1.11.0

type FakeResourceClient

type FakeResourceClient struct {
	Resource  schema.GroupVersionResource
	Kind      schema.GroupVersionKind
	Namespace string

	*testing.Fake
}

FakeResourceClient is a fake implementation of dynamic.ResourceInterface

func (*FakeResourceClient) Create

Create creates the provided resource.

func (*FakeResourceClient) Delete

func (c *FakeResourceClient) Delete(name string, opts *metav1.DeleteOptions) error

Delete deletes the resource with the specified name.

func (*FakeResourceClient) DeleteCollection

func (c *FakeResourceClient) DeleteCollection(deleteOptions *metav1.DeleteOptions, listOptions metav1.ListOptions) error

DeleteCollection deletes a collection of objects.

func (*FakeResourceClient) Get

Get gets the resource with the specified name.

func (*FakeResourceClient) List

List returns a list of objects for this resource.

func (*FakeResourceClient) Patch

Patch patches the provided resource.

func (*FakeResourceClient) Update

Update updates the provided resource.

func (*FakeResourceClient) Watch

Watch returns a watch.Interface that watches the resource.

Jump to

Keyboard shortcuts

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