Documentation
¶
Index ¶
- func StartControlLoop(ctx context.Context, iface Interactor, secretsNamespacer v1.SecretsGetter, ...) error
- func StartControlLoops(ctx context.Context, evtNamespacer InteractorNamespacer, ...)
- type Event
- type FakeInteractor
- func (f *FakeInteractor) Get(string) (*k8s.ServicePlanClaimWrapper, error)
- func (f *FakeInteractor) List(opts api.ListOptions) (*k8s.ServicePlanClaimsListWrapper, error)
- func (f *FakeInteractor) Update(*k8s.ServicePlanClaimWrapper) (*k8s.ServicePlanClaimWrapper, error)
- func (f *FakeInteractor) Watch(context.Context, api.ListOptions) Watcher
- type Interactor
- type InteractorNamespacer
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartControlLoop ¶
func StartControlLoop( ctx context.Context, iface Interactor, secretsNamespacer v1.SecretsGetter, lookup k8s.ServiceCatalogLookup, lifecycler *mode.Lifecycler, ) error
StartControlLoop starts an infinite loop that receives on watcher.ResultChan() and takes action on each change in service plan claims. It's intended to be called in a goroutine. Call watcher.Stop() to stop this loop
func StartControlLoops ¶
func StartControlLoops( ctx context.Context, evtNamespacer InteractorNamespacer, secretsNamespacer v1.SecretsGetter, lookup k8s.ServiceCatalogLookup, lifecycler *mode.Lifecycler, namespaces []string, errCh chan<- error, )
StartControlLoops calls StartControlLoop for each namespace in namespaces. For each call to StartControlLoop, it calls evtNamespacer.Events(ns) to create a new ConfigMapInterface. Because each StartControlLoop call is done in a new goroutine, this function need not be called in its own goroutine.
In order to stop all loops, pass a cancellable context to this function and call its cancel function
Types ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event represents the event that a service plan claim has changed in kubernetes. It implements fmt.Stringer
type FakeInteractor ¶
type FakeInteractor struct { }
FakeInteractor is a fake implementation of Interactor, to be use in unit testing
func (*FakeInteractor) Get ¶
func (f *FakeInteractor) Get(string) (*k8s.ServicePlanClaimWrapper, error)
Get is the Interactor interface implementation
func (*FakeInteractor) List ¶
func (f *FakeInteractor) List(opts api.ListOptions) (*k8s.ServicePlanClaimsListWrapper, error)
List is the Interactor interface implementation
func (*FakeInteractor) Update ¶
func (f *FakeInteractor) Update(*k8s.ServicePlanClaimWrapper) (*k8s.ServicePlanClaimWrapper, error)
Update is the Interactor interface implementation
func (*FakeInteractor) Watch ¶
func (f *FakeInteractor) Watch(context.Context, api.ListOptions) Watcher
Watch is the Interactor interface implementation
type Interactor ¶
type Interactor interface { Get(string) (*k8s.ServicePlanClaimWrapper, error) List(opts api.ListOptions) (*k8s.ServicePlanClaimsListWrapper, error) Update(*k8s.ServicePlanClaimWrapper) (*k8s.ServicePlanClaimWrapper, error) Watch(context.Context, api.ListOptions) Watcher }
Interactor is the interface that enables the requisite set of operations on claims that the control loop needs to do its job
type InteractorNamespacer ¶
type InteractorNamespacer interface {
Interactor(string) Interactor
}
InteractorNamespacer gets the Interface for a given namespace
func NewConfigMapsInteractorNamespacer ¶
func NewConfigMapsInteractorNamespacer(cmns v1.ConfigMapsGetter) InteractorNamespacer
NewConfigMapsInteractorNamespacer returns a new EventsNamespacer that works on config maps