claim

package
v0.0.0-...-035d3d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2017 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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

func (Event) String

func (e Event) String() string

String is the fmt.Stringer interface implementation

type FakeInteractor

type FakeInteractor struct {
}

FakeInteractor is a fake implementation of Interactor, to be use in unit testing

func (*FakeInteractor) Get

Get is the Interactor interface implementation

func (*FakeInteractor) List

List is the Interactor interface implementation

func (*FakeInteractor) Update

Update is the Interactor interface implementation

func (*FakeInteractor) Watch

Watch is the Interactor interface implementation

type Interactor

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

type Watcher

type Watcher interface {
	ResultChan() <-chan *Event
}

Watcher represents the watcher that returns service plan claims and returns them in ResultChan

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL