fake

package
v4.0.0-...-3ebc7ba Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultServerVersion = kubeversion.Info{Major: "1", Minor: "29"}
)

Functions

func AdmitCreate

func AdmitCreate() kubetesting.ReactionFunc

func LoadOpenAPISchema

func LoadOpenAPISchema() (*openapi_v2.Document, error)

func NewSimpleDynamicClient

NewSimpleDynamicClient creates a simple dynamic client for testing purposes, backed by fake discovery client and fake clientset as provided by the client-go library.

func NewSimpleLogClient

func NewSimpleLogClient(ctx context.Context, objects ...runtime.Object) (*clients.LogClient, *kubefake.Clientset)

Types

type NewDynamicClientOption

type NewDynamicClientOption func(*newDynamicClientOptions)

func WithObjects

func WithObjects(objects ...runtime.Object) NewDynamicClientOption

func WithScheme

func WithScheme(scheme *runtime.Scheme) NewDynamicClientOption

func WithServerVersion

func WithServerVersion(version kubeversion.Info) NewDynamicClientOption

type SimpleDiscovery

type SimpleDiscovery struct {
	*discoveryfake.FakeDiscovery
}

SimpleDiscovery provides a fake discovery client with core Kubernetes types.

func NewSimpleDiscovery

func NewSimpleDiscovery(serverVersion kubeversion.Info) *SimpleDiscovery

func (*SimpleDiscovery) Fresh

func (*SimpleDiscovery) Fresh() bool

func (*SimpleDiscovery) Invalidate

func (*SimpleDiscovery) Invalidate()

func (*SimpleDiscovery) OpenAPISchema

func (*SimpleDiscovery) OpenAPISchema() (*openapi_v2.Document, error)

type SimpleDynamicClient

type SimpleDynamicClient struct {
	*dynamicfake.FakeDynamicClient
}

func NewSimpleDynamicCLient

func NewSimpleDynamicCLient(scheme *runtime.Scheme, objects ...runtime.Object) *SimpleDynamicClient

NewSimpleDynamicCLient makes a simple dynamic client for testing purposes.

The client is backed by an in-memory object store that may be accessed via the Tracker() method. The given objects are converted to Unstructured objects as necessary and then added to the object store.

type SimpleRESTMapper

type SimpleRESTMapper struct {
	meta.RESTMapper
}

func NewSimpleRESTMapper

func NewSimpleRESTMapper(resources []*restmapper.APIGroupResources) *SimpleRESTMapper

NewSimpleRESTMapper creates a simple REST mapper for testing purposes, backed by the provided resource mappings.

Note: Generate resource mappings by calling discovery.GetAPIGroupResources with a working discovery client.

func (*SimpleRESTMapper) Reset

func (m *SimpleRESTMapper) Reset()

type StubResettableRESTMapper

type StubResettableRESTMapper struct {
	meta.ResettableRESTMapper
	ResetF                func()
	KindForF              func(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
	KindsForF             func(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
	ResourceForF          func(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
	ResourcesForF         func(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
	RESTMappingF          func(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
	RESTMappingsF         func(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
	ResourceSingularizerF func(resource string) (singular string, err error)
}

func (*StubResettableRESTMapper) KindFor

func (*StubResettableRESTMapper) KindsFor

func (*StubResettableRESTMapper) RESTMapping

func (m *StubResettableRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)

func (*StubResettableRESTMapper) RESTMappings

func (m *StubResettableRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)

func (*StubResettableRESTMapper) Reset

func (m *StubResettableRESTMapper) Reset()

func (*StubResettableRESTMapper) ResourceFor

func (*StubResettableRESTMapper) ResourceSingularizer

func (m *StubResettableRESTMapper) ResourceSingularizer(resource string) (singular string, err error)

func (*StubResettableRESTMapper) ResourcesFor

Jump to

Keyboard shortcuts

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