fake

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSchemeAndCodecs

func NewSchemeAndCodecs() (*runtime.Scheme, *serializer.CodecFactory, error)

NewSchemeAndCodecs returns a new scheme populated with the types defined in clientSetSchemes.

Types

type ApplyHookType

type ApplyHookType func(obj runtime.Object, namespace string, forceConflicts bool) error

ApplyHookType is the signature of the function that will be called to examine the parameters that the apply function was called with.

type ClientsetSubset

ClientsetSubset is just the fake clientset struct

type DraconClientSet

type DraconClientSet struct {
	ClientsetSubset

	ApplyHook      ApplyHookType
	MetaRESTMapper meta.RESTMapper
	// contains filtered or unexported fields
}

DraconClientSet is a mock implementation of the `k8s.Clientset`

func NewFakeTypedClient

func NewFakeTypedClient(objects ...runtime.Object) (DraconClientSet, error)

NewFakeTypedClient returns a mock K8s client that implements the `k8s.ClientInterface` and a `meta.RESTMapper` implementation that can return a correct response for all known types offered by the `k8s.ClientInterface`.

func NewFakeTypedClientWithApplyHook

func NewFakeTypedClientWithApplyHook(applyHook ApplyHookType, objects ...runtime.Object) (DraconClientSet, error)

NewFakeTypedClientWithApplyHook returns a mock client that implements the `k8s.ClientInterface` and a `meta.RESTMapper` implementation that can return a correct response for all known types offered by the `k8s.ClientInterface`.

func (DraconClientSet) Apply

func (f DraconClientSet) Apply(_ context.Context, obj runtime.Object, namespace string, forceConflicts bool) error

Apply mocks the `kubectl apply`

func (DraconClientSet) RESTMapper

func (f DraconClientSet) RESTMapper() meta.RESTMapper

RESTMapper returns an instance implementing the `meta.RESTMapper` interface

Jump to

Keyboard shortcuts

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