Documentation
¶
Index ¶
- func NewClient(scheme *runtime.Scheme, opts ...ClientOption) dynamic.Interface
- func NewFakeDynamicClient(scheme *runtime.Scheme, objects ...runtime.Object) dynamic.Interface
- func NewFakeDynamicClientWithCustomListKinds(scheme *runtime.Scheme, gvrToListKind map[schema.GroupVersionResource]string, ...) dynamic.Interface
- type ClientOption
- func WithCRDBytes(crdData ...[]byte) ClientOption
- func WithCRDs(crds ...*apiextensionsv1.CustomResourceDefinition) ClientOption
- func WithCustomGVRMappings(mappings map[schema.GroupVersionResource]string) ClientOption
- func WithObjects(objects ...runtime.Object) ClientOption
- func WithOpenAPISpec(specPath string) ClientOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(scheme *runtime.Scheme, opts ...ClientOption) dynamic.Interface
NewClient creates a fake dynamic client with the specified options. This is the main constructor that all other constructors delegate to.
func NewFakeDynamicClient ¶
NewFakeDynamicClient creates a fake dynamic client with apply support. The API mirrors the upstream dynamic fake client exactly.
func NewFakeDynamicClientWithCustomListKinds ¶
func NewFakeDynamicClientWithCustomListKinds(scheme *runtime.Scheme, gvrToListKind map[schema.GroupVersionResource]string, objects ...runtime.Object) dynamic.Interface
NewFakeDynamicClientWithCustomListKinds creates a fake dynamic client with custom GVR to ListKind mappings, mirroring the upstream API exactly. This allows you to override or supplement the auto-detected mappings.
Types ¶
type ClientOption ¶
type ClientOption func(*clientConfig)
ClientOption configures a fake dynamic client
func WithCRDBytes ¶
func WithCRDBytes(crdData ...[]byte) ClientOption
WithCRDBytes adds CRDs from byte data (YAML/JSON) to the fake client
func WithCRDs ¶
func WithCRDs(crds ...*apiextensionsv1.CustomResourceDefinition) ClientOption
WithCRDs adds CRDs to the fake client
func WithCustomGVRMappings ¶
func WithCustomGVRMappings(mappings map[schema.GroupVersionResource]string) ClientOption
WithCustomGVRMappings adds custom GVR to ListKind mappings
func WithObjects ¶
func WithObjects(objects ...runtime.Object) ClientOption
WithObjects adds initial objects to the fake client
func WithOpenAPISpec ¶
func WithOpenAPISpec(specPath string) ClientOption
WithOpenAPISpec sets a custom OpenAPI spec file path