Documentation
¶
Index ¶
- func NewConflictHandler() conflict.Handler
- func NewDiscoveryClient(gvks ...schema.GroupVersionKind) discoveryutil.ServerResourcer
- func NewDiscoveryClientWithError(wantedErr error, gvks ...schema.GroupVersionKind) discoveryutil.ServerResourcer
- func NewErrorClient(err error) client.Client
- func NewFightHandler() fight.Handler
- type Applier
- func (a *Applier) Create(ctx context.Context, obj *unstructured.Unstructured) status.Error
- func (a *Applier) Delete(ctx context.Context, obj *unstructured.Unstructured) status.Error
- func (a *Applier) GetClient() client.Client
- func (a *Applier) RemoveNomosMeta(ctx context.Context, intent *unstructured.Unstructured, _ string) status.Error
- func (a *Applier) Update(ctx context.Context, intendedState, _ *unstructured.Unstructured) status.Error
- type Client
- func (c *Client) Applier() reconcile.Applier
- func (c *Client) Check(t *testing.T, wants ...client.Object)
- func (c *Client) Create(_ context.Context, obj client.Object, opts ...client.CreateOption) error
- func (c *Client) Delete(_ context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (c *Client) DeleteAllOf(_ context.Context, _ client.Object, _ ...client.DeleteAllOfOption) error
- func (c *Client) Get(_ context.Context, key client.ObjectKey, obj client.Object) error
- func (c *Client) List(_ context.Context, list client.ObjectList, opts ...client.ListOption) error
- func (c *Client) Patch(_ context.Context, obj client.Object, patch client.Patch, ...) error
- func (c *Client) RESTMapper() meta.RESTMapper
- func (c *Client) Scheme() *runtime.Scheme
- func (c *Client) Status() client.StatusWriter
- func (c *Client) Update(_ context.Context, obj client.Object, opts ...client.UpdateOption) error
- type ConflictHandler
- type DynamicClient
- type ErrorClient
- func (e ErrorClient) Create(_ context.Context, _ client.Object, _ ...client.CreateOption) error
- func (e ErrorClient) Delete(_ context.Context, _ client.Object, _ ...client.DeleteOption) error
- func (e ErrorClient) DeleteAllOf(_ context.Context, _ client.Object, _ ...client.DeleteAllOfOption) error
- func (e ErrorClient) Get(_ context.Context, _ client.ObjectKey, _ client.Object) error
- func (e ErrorClient) List(_ context.Context, _ client.ObjectList, _ ...client.ListOption) error
- func (e ErrorClient) Patch(_ context.Context, _ client.Object, _ client.Patch, _ ...client.PatchOption) error
- func (e ErrorClient) RESTMapper() meta.RESTMapper
- func (e ErrorClient) Scheme() *runtime.Scheme
- func (e ErrorClient) Status() client.StatusWriter
- func (e ErrorClient) Update(_ context.Context, _ client.Object, _ ...client.UpdateOption) error
- type FightHandler
- type UnstructuredFields
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConflictHandler ¶ added in v1.15.1
NewConflictHandler initiates a fake implementation of conflict.Handler.
func NewDiscoveryClient ¶
func NewDiscoveryClient(gvks ...schema.GroupVersionKind) discoveryutil.ServerResourcer
NewDiscoveryClient returns a discoveryClient that reports types available to the API Server with no errors
Does not report the scope of each GVK as no tests requiring a discoveryClient use scope information.
func NewDiscoveryClientWithError ¶ added in v1.15.1
func NewDiscoveryClientWithError(wantedErr error, gvks ...schema.GroupVersionKind) discoveryutil.ServerResourcer
NewDiscoveryClientWithError returns a discoveryClient that reports types available to the API Server with no errors, or ErrGroupDiscoveryFailed error with the specified wantedErr
Does not report the scope of each GVK as no tests requiring a discoveryClient use scope information.
func NewErrorClient ¶
NewErrorClient returns a Client that always returns an error.
func NewFightHandler ¶ added in v1.15.1
NewFightHandler initiates a fake implementation of fight.Handler.
Types ¶
type Applier ¶ added in v1.15.1
type Applier struct { Client *Client CreateError status.Error UpdateError status.Error DeleteError status.Error }
Applier implements a fake reconcile.Applier for use in testing.
reconcile.Applier not imported due to import cycle considerations.
func (*Applier) Create ¶ added in v1.15.1
func (a *Applier) Create(ctx context.Context, obj *unstructured.Unstructured) status.Error
Create implements reconcile.Applier.
func (*Applier) Delete ¶ added in v1.15.1
func (a *Applier) Delete(ctx context.Context, obj *unstructured.Unstructured) status.Error
Delete implements reconcile.Applier.
func (*Applier) RemoveNomosMeta ¶ added in v1.15.1
func (a *Applier) RemoveNomosMeta(ctx context.Context, intent *unstructured.Unstructured, _ string) status.Error
RemoveNomosMeta implements reconcile.Applier.
func (*Applier) Update ¶ added in v1.15.1
func (a *Applier) Update(ctx context.Context, intendedState, _ *unstructured.Unstructured) status.Error
Update implements reconcile.Applier.
type Client ¶
Client is a fake implementation of client.Client.
func NewClient ¶
NewClient instantiates a new fake.Client pre-populated with the specified objects.
Calls t.Fatal if unable to properly instantiate Client.
func (*Client) Applier ¶
Applier returns a fake.Applier wrapping this fake.Client. Callers using the resulting Applier will read from/write to the original fake.Client.
func (*Client) Check ¶
Check reports an error to `t` if the passed objects in wants do not match the expected set of objects in the fake.Client, and only the passed updates to Status fields were recorded.
func (*Client) DeleteAllOf ¶
func (c *Client) DeleteAllOf(_ context.Context, _ client.Object, _ ...client.DeleteAllOfOption) error
DeleteAllOf implements client.Client.
func (*Client) List ¶
func (c *Client) List(_ context.Context, list client.ObjectList, opts ...client.ListOption) error
List implements client.Client.
Does not paginate results.
func (*Client) Patch ¶
func (c *Client) Patch(_ context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error
Patch implements client.Client.
func (*Client) RESTMapper ¶
func (c *Client) RESTMapper() meta.RESTMapper
RESTMapper implements client.Client.
func (*Client) Status ¶
func (c *Client) Status() client.StatusWriter
Status implements client.Client.
type ConflictHandler ¶ added in v1.15.1
type ConflictHandler struct{}
ConflictHandler is a fake implementation of conflict.Handler.
func (*ConflictHandler) AddConflictError ¶ added in v1.15.1
func (h *ConflictHandler) AddConflictError(queue.GVKNN, status.ManagementConflictError)
AddConflictError is a fake implementation of AddConflictError of conflict.Handler.
func (*ConflictHandler) ConflictErrors ¶ added in v1.15.1
func (h *ConflictHandler) ConflictErrors() []status.ManagementConflictError
ConflictErrors is a fake implementation of ConflictErrors of conflict.Handler.
func (*ConflictHandler) RemoveAllConflictErrors ¶ added in v1.15.1
func (h *ConflictHandler) RemoveAllConflictErrors(schema.GroupVersionKind)
RemoveAllConflictErrors is a fake implementation of RemoveAllConflictErrors of conflict.Handler.
func (*ConflictHandler) RemoveConflictError ¶ added in v1.15.1
func (h *ConflictHandler) RemoveConflictError(queue.GVKNN)
RemoveConflictError is a fake implementation of the RemoveConflictError of conflict.Handler.
type DynamicClient ¶ added in v1.15.1
type DynamicClient struct { *dynamicfake.FakeDynamicClient // contains filtered or unexported fields }
DynamicClient is a fake dynamic client which contains a map to store unstructured objects
func NewDynamicClient ¶ added in v1.15.1
func NewDynamicClient(t *testing.T, scheme *runtime.Scheme) *DynamicClient
NewDynamicClient instantiates a new fake.DynamicClient
func (*DynamicClient) Check ¶ added in v1.15.1
func (dc *DynamicClient) Check(t *testing.T, wants ...client.Object)
Check reports an error to `t` if the passed objects in wants do not match the expected set of objects in the fake.Client, and only the passed updates to Status fields were recorded.
func (*DynamicClient) Put ¶ added in v1.15.1
func (dc *DynamicClient) Put(t *testing.T, obj *unstructured.Unstructured)
Put adds the object to the cache, with metadata validation.
Use for test initialization to simulate exact cluster state.
func (*DynamicClient) PutAll ¶ added in v1.15.1
func (dc *DynamicClient) PutAll(t *testing.T, objs ...*unstructured.Unstructured)
PutAll loops through the objects and adds them to the cache, with metadata validation.
Use for test initialization to simulate exact cluster state.
type ErrorClient ¶
type ErrorClient struct {
// contains filtered or unexported fields
}
ErrorClient is a Client that always returns a specified error.
func (ErrorClient) Create ¶
func (e ErrorClient) Create(_ context.Context, _ client.Object, _ ...client.CreateOption) error
Create implements client.Client.
func (ErrorClient) Delete ¶
func (e ErrorClient) Delete(_ context.Context, _ client.Object, _ ...client.DeleteOption) error
Delete implements client.Client.
func (ErrorClient) DeleteAllOf ¶
func (e ErrorClient) DeleteAllOf(_ context.Context, _ client.Object, _ ...client.DeleteAllOfOption) error
DeleteAllOf implements client.Client.
func (ErrorClient) List ¶
func (e ErrorClient) List(_ context.Context, _ client.ObjectList, _ ...client.ListOption) error
List implements client.Client.
func (ErrorClient) Patch ¶
func (e ErrorClient) Patch(_ context.Context, _ client.Object, _ client.Patch, _ ...client.PatchOption) error
Patch implements client.Client.
func (ErrorClient) RESTMapper ¶
func (e ErrorClient) RESTMapper() meta.RESTMapper
RESTMapper implements client.Client.
func (ErrorClient) Scheme ¶
func (e ErrorClient) Scheme() *runtime.Scheme
Scheme implements client.Client.
func (ErrorClient) Status ¶
func (e ErrorClient) Status() client.StatusWriter
Status implements client.Client.
func (ErrorClient) Update ¶
func (e ErrorClient) Update(_ context.Context, _ client.Object, _ ...client.UpdateOption) error
Update implements client.Client.
type FightHandler ¶ added in v1.15.1
type FightHandler struct{}
FightHandler is a fake implementation of fight.Handler.
func (*FightHandler) AddFightError ¶ added in v1.15.1
func (h *FightHandler) AddFightError(core.ID, status.Error)
AddFightError is a fake implementation of the AddFightError of fight.Handler.
func (*FightHandler) FightErrors ¶ added in v1.15.1
func (h *FightHandler) FightErrors() []status.Error
FightErrors is a fake implementation of the FightErrors of fight.Handler.
func (*FightHandler) RemoveFightError ¶ added in v1.15.1
func (h *FightHandler) RemoveFightError(core.ID)
RemoveFightError is a fake implementation of the RemoveFightError of fight.Handler.
type UnstructuredFields ¶ added in v1.15.1
type UnstructuredFields struct {
Object *unstructured.Unstructured
}
UnstructuredFields impliments fields.Fields to do field selection on any field in an unstructured object.
func (*UnstructuredFields) Get ¶ added in v1.15.1
func (uf *UnstructuredFields) Get(field string) (value string)
Get returns the value for the provided field.
func (*UnstructuredFields) Has ¶ added in v1.15.1
func (uf *UnstructuredFields) Has(field string) (exists bool)
Has returns whether the provided field exists.