fake

package
v0.56.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 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 SmithyClientSet

type SmithyClientSet struct {
	ClientsetSubset

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

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

func NewFakeTypedClient

func NewFakeTypedClient(objects ...runtime.Object) (SmithyClientSet, 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) (SmithyClientSet, 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 (SmithyClientSet) Apply

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

Apply mocks the `kubectl apply`

func (SmithyClientSet) RESTMapper

func (f SmithyClientSet) 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