Documentation ¶
Index ¶
- type KubectlOutput
- type MockKubectlCmd
- func (k *MockKubectlCmd) ConvertToVersion(obj *unstructured.Unstructured, group, version string) (*unstructured.Unstructured, error)
- func (k *MockKubectlCmd) CreateResource(ctx context.Context, config *rest.Config, gvk schema.GroupVersionKind, ...) (*unstructured.Unstructured, error)
- func (k *MockKubectlCmd) DeleteResource(ctx context.Context, config *rest.Config, gvk schema.GroupVersionKind, ...) error
- func (k *MockKubectlCmd) GetAPIResources(config *rest.Config, preferred bool, resourceFilter kube.ResourceFilter) ([]kube.APIResourceInfo, error)
- func (k *MockKubectlCmd) GetResource(ctx context.Context, config *rest.Config, gvk schema.GroupVersionKind, ...) (*unstructured.Unstructured, error)
- func (k *MockKubectlCmd) GetServerVersion(config *rest.Config) (string, error)
- func (k *MockKubectlCmd) LoadOpenAPISchema(config *rest.Config) (openapi.Resources, *managedfields.GvkParser, error)
- func (k *MockKubectlCmd) ManageResources(config *rest.Config, openAPISchema openapi.Resources) (kube.ResourceOperations, func(), error)
- func (k *MockKubectlCmd) NewDynamicClient(config *rest.Config) (dynamic.Interface, error)
- func (k *MockKubectlCmd) PatchResource(ctx context.Context, config *rest.Config, gvk schema.GroupVersionKind, ...) (*unstructured.Unstructured, error)
- func (k *MockKubectlCmd) SetOnKubectlRun(onKubectlRun kube.OnKubectlRunFunc)
- func (k *MockKubectlCmd) WithConvertToVersionFunc(...) *MockKubectlCmd
- func (k *MockKubectlCmd) WithGetResourceFunc(...) *MockKubectlCmd
- type MockResourceOps
- func (r *MockResourceOps) ApplyResource(ctx context.Context, obj *unstructured.Unstructured, ...) (string, error)
- func (r *MockResourceOps) CreateResource(ctx context.Context, obj *unstructured.Unstructured, ...) (string, error)
- func (r *MockResourceOps) GetLastForce() bool
- func (r *MockResourceOps) GetLastResourceCommand(key kube.ResourceKey) string
- func (r *MockResourceOps) GetLastServerSideApply() bool
- func (r *MockResourceOps) GetLastServerSideApplyManager() string
- func (r *MockResourceOps) GetLastValidate() bool
- func (r *MockResourceOps) ReplaceResource(ctx context.Context, obj *unstructured.Unstructured, ...) (string, error)
- func (r *MockResourceOps) SetLastForce(force bool)
- func (r *MockResourceOps) SetLastResourceCommand(key kube.ResourceKey, cmd string)
- func (r *MockResourceOps) SetLastServerSideApply(serverSideApply bool)
- func (r *MockResourceOps) SetLastServerSideApplyManager(manager string)
- func (r *MockResourceOps) SetLastValidate(validate bool)
- func (r *MockResourceOps) UpdateResource(ctx context.Context, obj *unstructured.Unstructured, ...) (*unstructured.Unstructured, error)
- func (r *MockResourceOps) WithGetResourceFunc(...) *MockResourceOps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KubectlOutput ¶
type MockKubectlCmd ¶
type MockKubectlCmd struct { APIResources []kube.APIResourceInfo Commands map[string]KubectlOutput Events chan watch.Event Version string DynamicClient dynamic.Interface // contains filtered or unexported fields }
func (*MockKubectlCmd) ConvertToVersion ¶
func (k *MockKubectlCmd) ConvertToVersion(obj *unstructured.Unstructured, group, version string) (*unstructured.Unstructured, error)
ConvertToVersion converts an unstructured object into the specified group/version
func (*MockKubectlCmd) CreateResource ¶
func (k *MockKubectlCmd) CreateResource(ctx context.Context, config *rest.Config, gvk schema.GroupVersionKind, name string, namespace string, obj *unstructured.Unstructured, createOptions metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error)
func (*MockKubectlCmd) DeleteResource ¶
func (k *MockKubectlCmd) DeleteResource(ctx context.Context, config *rest.Config, gvk schema.GroupVersionKind, name string, namespace string, deleteOptions metav1.DeleteOptions) error
func (*MockKubectlCmd) GetAPIResources ¶
func (k *MockKubectlCmd) GetAPIResources(config *rest.Config, preferred bool, resourceFilter kube.ResourceFilter) ([]kube.APIResourceInfo, error)
func (*MockKubectlCmd) GetResource ¶
func (k *MockKubectlCmd) GetResource(ctx context.Context, config *rest.Config, gvk schema.GroupVersionKind, name string, namespace string) (*unstructured.Unstructured, error)
func (*MockKubectlCmd) GetServerVersion ¶
func (k *MockKubectlCmd) GetServerVersion(config *rest.Config) (string, error)
func (*MockKubectlCmd) LoadOpenAPISchema ¶
func (k *MockKubectlCmd) LoadOpenAPISchema(config *rest.Config) (openapi.Resources, *managedfields.GvkParser, error)
func (*MockKubectlCmd) ManageResources ¶
func (k *MockKubectlCmd) ManageResources(config *rest.Config, openAPISchema openapi.Resources) (kube.ResourceOperations, func(), error)
func (*MockKubectlCmd) NewDynamicClient ¶
func (*MockKubectlCmd) PatchResource ¶
func (k *MockKubectlCmd) PatchResource(ctx context.Context, config *rest.Config, gvk schema.GroupVersionKind, name string, namespace string, patchType types.PatchType, patchBytes []byte, subresources ...string) (*unstructured.Unstructured, error)
func (*MockKubectlCmd) SetOnKubectlRun ¶
func (k *MockKubectlCmd) SetOnKubectlRun(onKubectlRun kube.OnKubectlRunFunc)
func (*MockKubectlCmd) WithConvertToVersionFunc ¶
func (k *MockKubectlCmd) WithConvertToVersionFunc(convertToVersionFunc func(*unstructured.Unstructured, string, string) (*unstructured.Unstructured, error)) *MockKubectlCmd
WithConvertToVersionFunc overrides the default ConvertToVersion behavior.
func (*MockKubectlCmd) WithGetResourceFunc ¶
func (k *MockKubectlCmd) WithGetResourceFunc(getResourcefunc func(context.Context, *rest.Config, schema.GroupVersionKind, string, string) (*unstructured.Unstructured, error)) *MockKubectlCmd
WithGetResourceFunc overrides the default ConvertToVersion behavior.
type MockResourceOps ¶
type MockResourceOps struct { Commands map[string]KubectlOutput Events chan watch.Event DynamicClient dynamic.Interface // contains filtered or unexported fields }
func (*MockResourceOps) ApplyResource ¶
func (r *MockResourceOps) ApplyResource(ctx context.Context, obj *unstructured.Unstructured, dryRunStrategy cmdutil.DryRunStrategy, force, validate, serverSideApply bool, manager string, serverSideDiff bool) (string, error)
func (*MockResourceOps) CreateResource ¶
func (r *MockResourceOps) CreateResource(ctx context.Context, obj *unstructured.Unstructured, dryRunStrategy cmdutil.DryRunStrategy, validate bool) (string, error)
func (*MockResourceOps) GetLastForce ¶
func (r *MockResourceOps) GetLastForce() bool
func (*MockResourceOps) GetLastResourceCommand ¶
func (r *MockResourceOps) GetLastResourceCommand(key kube.ResourceKey) string
func (*MockResourceOps) GetLastServerSideApply ¶
func (r *MockResourceOps) GetLastServerSideApply() bool
func (*MockResourceOps) GetLastServerSideApplyManager ¶
func (r *MockResourceOps) GetLastServerSideApplyManager() string
func (*MockResourceOps) GetLastValidate ¶
func (r *MockResourceOps) GetLastValidate() bool
func (*MockResourceOps) ReplaceResource ¶
func (r *MockResourceOps) ReplaceResource(ctx context.Context, obj *unstructured.Unstructured, dryRunStrategy cmdutil.DryRunStrategy, force bool) (string, error)
func (*MockResourceOps) SetLastForce ¶
func (r *MockResourceOps) SetLastForce(force bool)
func (*MockResourceOps) SetLastResourceCommand ¶
func (r *MockResourceOps) SetLastResourceCommand(key kube.ResourceKey, cmd string)
func (*MockResourceOps) SetLastServerSideApply ¶
func (r *MockResourceOps) SetLastServerSideApply(serverSideApply bool)
func (*MockResourceOps) SetLastServerSideApplyManager ¶
func (r *MockResourceOps) SetLastServerSideApplyManager(manager string)
func (*MockResourceOps) SetLastValidate ¶
func (r *MockResourceOps) SetLastValidate(validate bool)
func (*MockResourceOps) UpdateResource ¶
func (r *MockResourceOps) UpdateResource(ctx context.Context, obj *unstructured.Unstructured, dryRunStrategy cmdutil.DryRunStrategy) (*unstructured.Unstructured, error)
func (*MockResourceOps) WithGetResourceFunc ¶
func (r *MockResourceOps) WithGetResourceFunc(getResourcefunc func(context.Context, *rest.Config, schema.GroupVersionKind, string, string) (*unstructured.Unstructured, error)) *MockResourceOps
WithGetResourceFunc overrides the default ConvertToVersion behavior.
Click to show internal directories.
Click to hide internal directories.