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 ¶
- type FakeClient
- type FakeClientPool
- type FakeResourceClient
- func (c *FakeResourceClient) Create(inObj *unstructured.Unstructured) (*unstructured.Unstructured, error)
- func (c *FakeResourceClient) Delete(name string, opts *metav1.DeleteOptions) error
- func (c *FakeResourceClient) DeleteCollection(deleteOptions *metav1.DeleteOptions, listOptions metav1.ListOptions) error
- func (c *FakeResourceClient) Get(name string, opts metav1.GetOptions) (*unstructured.Unstructured, error)
- func (c *FakeResourceClient) List(opts metav1.ListOptions) (runtime.Object, error)
- func (c *FakeResourceClient) Patch(name string, pt types.PatchType, data []byte) (*unstructured.Unstructured, error)
- func (c *FakeResourceClient) Update(inObj *unstructured.Unstructured) (*unstructured.Unstructured, error)
- func (c *FakeResourceClient) Watch(opts metav1.ListOptions) (watch.Interface, error)
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 paramater codec of this client
type FakeClientPool ¶
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 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 ¶
func (c *FakeResourceClient) Create(inObj *unstructured.Unstructured) (*unstructured.Unstructured, error)
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 ¶
func (c *FakeResourceClient) Get(name string, opts metav1.GetOptions) (*unstructured.Unstructured, error)
Get gets the resource with the specified name.
func (*FakeResourceClient) List ¶
func (c *FakeResourceClient) List(opts metav1.ListOptions) (runtime.Object, error)
List returns a list of objects for this resource.
func (*FakeResourceClient) Patch ¶
func (c *FakeResourceClient) Patch(name string, pt types.PatchType, data []byte) (*unstructured.Unstructured, error)
Patch patches the provided resource.
func (*FakeResourceClient) Update ¶
func (c *FakeResourceClient) Update(inObj *unstructured.Unstructured) (*unstructured.Unstructured, error)
Update updates the provided resource.
func (*FakeResourceClient) Watch ¶
func (c *FakeResourceClient) Watch(opts metav1.ListOptions) (watch.Interface, error)
Watch returns a watch.Interface that watches the resource.