fake

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeCRD

type FakeCRD struct{}

FakeCRD is a fake implementation of CRDInterface for testing

func (*FakeCRD) Delete

func (f *FakeCRD) Delete(ctx context.Context, name string) error

Delete removes a CRD if it exists

func (*FakeCRD) Ensure

func (f *FakeCRD) Ensure(ctx context.Context, crd v1.CustomResourceDefinition, allowBreakingChanges bool) error

Ensure ensures a CRD exists, up-to-date, and is ready

func (*FakeCRD) Get

Get retrieves a CRD by name

type FakeSet

type FakeSet struct {
	DynamicClient       dynamic.Interface
	KubernetesClient    kubernetes.Interface
	ApiExtensionsClient apiextensionsv1.ApiextensionsV1Interface
	Config              *rest.Config

	HTTP *http.Client
	// contains filtered or unexported fields
}

FakeSet is a fake implementation of SetInterface for testing

func NewFakeSet

func NewFakeSet(dynamicClient dynamic.Interface) *FakeSet

NewFakeSet creates a new FakeSet with the given clients

func (*FakeSet) APIExtensionsV1

func (f *FakeSet) APIExtensionsV1() apiextensionsv1.ApiextensionsV1Interface

APIExtensionsV1 returns the API extensions client

func (*FakeSet) CRD

CRD returns a new CRD interface instance

func (*FakeSet) Dynamic

func (f *FakeSet) Dynamic() dynamic.Interface

Dynamic returns the dynamic client

func (*FakeSet) HTTPClient

func (f *FakeSet) HTTPClient() *http.Client

func (*FakeSet) Kubernetes

func (f *FakeSet) Kubernetes() kubernetes.Interface

Kubernetes returns the standard Kubernetes clientset

func (*FakeSet) RESTConfig

func (f *FakeSet) RESTConfig() *rest.Config

RESTConfig returns a copy of the underlying REST config

func (*FakeSet) RESTMapper

func (f *FakeSet) RESTMapper() meta.RESTMapper

func (*FakeSet) SetRESTMapper

func (f *FakeSet) SetRESTMapper(restMapper meta.RESTMapper)

func (*FakeSet) WithImpersonation

func (f *FakeSet) WithImpersonation(user string) (client.SetInterface, error)

WithImpersonation returns a new client that impersonates the given user For testing, this just returns the same fake client

type JSONSafeDynamicClient

type JSONSafeDynamicClient struct {
	// contains filtered or unexported fields
}

JSONSafeDynamicClient wraps a fake dynamic client and performs JSON marshal/unmarshal to sanitize data before passing it to the underlying client, preventing deep copy issues with pointer fields

func NewJSONSafeDynamicClient

func NewJSONSafeDynamicClient(client dynamic.Interface) *JSONSafeDynamicClient

NewJSONSafeDynamicClient creates a new JSON-safe wrapper around a dynamic client

func (*JSONSafeDynamicClient) Resource

Resource returns a resource interface for the given resource

Jump to

Keyboard shortcuts

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