controller

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2015 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocation

type Allocation struct {
	// contains filtered or unexported fields
}

func (*Allocation) Next

func (c *Allocation) Next(ns *kapi.Namespace) error

Next processes a changed namespace and tries to allocate a uid range for it. If it is successful, an mcs label corresponding to the relative position of the range is also set.

type AllocationFactory

type AllocationFactory struct {
	UIDAllocator uidallocator.Interface
	MCSAllocator MCSAllocationFunc
	Client       kclient.NamespaceInterface
	// Queue may be a FIFO queue of namespaces. If nil, will be initialized using
	// the client.
	Queue controller.ReQueue
}

AllocationFactory can create an Allocation controller.

func (*AllocationFactory) Create

Create creates a Allocation.

type MCSAllocationFunc

type MCSAllocationFunc func(uid.Block) *mcs.Label

func DefaultMCSAllocation

func DefaultMCSAllocation(from *uid.Range, to *mcs.Range, blockSize int) MCSAllocationFunc

DefaultMCSAllocation returns a label from the MCS range that matches the offset within the overall range. blockSize must be a positive integer representing the number of labels to jump past in the category space (if 1, range == label, if 2 each range will have two labels).

type Repair

type Repair struct {
	// contains filtered or unexported fields
}

Repair is a controller loop that periodically examines all UID allocations and logs any errors, and then sets the compacted and accurate list of both

Can be run at infrequent intervals, and is best performed on startup of the master. Is level driven and idempotent - all claimed UIDs will be updated into the allocator map at the end of a single execution loop if no race is encountered.

func NewRepair

func NewRepair(interval time.Duration, client client.NamespaceInterface, uidRange *uid.Range, alloc service.RangeRegistry) *Repair

NewRepair creates a controller that periodically ensures that all UIDs labels that are allocated in the cluster are claimed.

func (*Repair) RunOnce

func (c *Repair) RunOnce() error

RunOnce verifies the state of allocations and returns an error if an unrecoverable problem occurs.

func (*Repair) RunUntil

func (c *Repair) RunUntil(ch chan struct{})

RunUntil starts the controller until the provided ch is closed.

Jump to

Keyboard shortcuts

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