Documentation ¶
Overview ¶
Package controllerstate provides adapter which filters access to the resource state by controller inputs/outputs.
Index ¶
- type StateAdapter
- func (adapter *StateAdapter) AddFinalizer(ctx context.Context, resourcePointer resource.Pointer, ...) error
- func (adapter *StateAdapter) ContextWithTeardown(ctx context.Context, resourcePointer resource.Pointer) (context.Context, error)
- func (adapter *StateAdapter) Create(ctx context.Context, r resource.Resource) error
- func (adapter *StateAdapter) Destroy(ctx context.Context, resourcePointer resource.Pointer, ...) error
- func (adapter *StateAdapter) Get(ctx context.Context, resourcePointer resource.Pointer, opts ...state.GetOption) (resource.Resource, error)
- func (adapter *StateAdapter) GetUncached(ctx context.Context, resourcePointer resource.Pointer, opts ...state.GetOption) (resource.Resource, error)
- func (adapter *StateAdapter) List(ctx context.Context, resourceKind resource.Kind, opts ...state.ListOption) (resource.List, error)
- func (adapter *StateAdapter) ListUncached(ctx context.Context, resourceKind resource.Kind, opts ...state.ListOption) (resource.List, error)
- func (adapter *StateAdapter) Modify(ctx context.Context, emptyResource resource.Resource, ...) error
- func (adapter *StateAdapter) ModifyWithResult(ctx context.Context, emptyResource resource.Resource, ...) (resource.Resource, error)
- func (adapter *StateAdapter) RemoveFinalizer(ctx context.Context, resourcePointer resource.Pointer, ...) error
- func (adapter *StateAdapter) Teardown(ctx context.Context, resourcePointer resource.Pointer, ...) (bool, error)
- func (adapter *StateAdapter) Update(ctx context.Context, newResource resource.Resource) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StateAdapter ¶
type StateAdapter struct { State state.State Cache *cache.ResourceCache Name string UpdateLimiter *rate.Limiter Logger *zap.Logger Inputs []controller.Input Outputs []controller.Output WarnOnUncachedReads bool }
StateAdapter implements filtered access to the resource state by controller inputs/outputs.
If the read cache is enabled for a resource type, controller.Reader interface will be redirected to the cache.
func (*StateAdapter) AddFinalizer ¶
func (adapter *StateAdapter) AddFinalizer(ctx context.Context, resourcePointer resource.Pointer, fins ...resource.Finalizer) error
AddFinalizer implements controller.Runtime interface.
func (*StateAdapter) ContextWithTeardown ¶
func (adapter *StateAdapter) ContextWithTeardown(ctx context.Context, resourcePointer resource.Pointer) (context.Context, error)
ContextWithTeardown implements controller.Runtime interface.
func (*StateAdapter) Destroy ¶
func (adapter *StateAdapter) Destroy(ctx context.Context, resourcePointer resource.Pointer, opOpts ...controller.Option) error
Destroy implements controller.Runtime interface.
func (*StateAdapter) Get ¶
func (adapter *StateAdapter) Get(ctx context.Context, resourcePointer resource.Pointer, opts ...state.GetOption) (resource.Resource, error)
Get implements controller.Runtime interface.
func (*StateAdapter) GetUncached ¶ added in v0.4.6
func (adapter *StateAdapter) GetUncached(ctx context.Context, resourcePointer resource.Pointer, opts ...state.GetOption) (resource.Resource, error)
GetUncached implements controller.Runtime interface.
func (*StateAdapter) List ¶
func (adapter *StateAdapter) List(ctx context.Context, resourceKind resource.Kind, opts ...state.ListOption) (resource.List, error)
List implements controller.Runtime interface.
func (*StateAdapter) ListUncached ¶ added in v0.4.6
func (adapter *StateAdapter) ListUncached(ctx context.Context, resourceKind resource.Kind, opts ...state.ListOption) (resource.List, error)
ListUncached implements controller.Runtime interface.
func (*StateAdapter) Modify ¶
func (adapter *StateAdapter) Modify(ctx context.Context, emptyResource resource.Resource, updateFunc func(resource.Resource) error) error
Modify implements controller.Runtime interface.
func (*StateAdapter) ModifyWithResult ¶
func (adapter *StateAdapter) ModifyWithResult(ctx context.Context, emptyResource resource.Resource, updateFunc func(resource.Resource) error) (resource.Resource, error)
ModifyWithResult implements controller.Runtime interface.
func (*StateAdapter) RemoveFinalizer ¶
func (adapter *StateAdapter) RemoveFinalizer(ctx context.Context, resourcePointer resource.Pointer, fins ...resource.Finalizer) error
RemoveFinalizer implements controller.Runtime interface.