provider

package
v0.0.0-...-3a937ec Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Plan

func Plan(left, right allocation.ProviderSlice) (create, update allocation.ProviderSlice, destroy []string)

Plan determines changes between left and right for one pod

Types

type Evaluator

type Evaluator struct {
	*supervisor.Control
	// contains filtered or unexported fields
}

Providers evaluator

func NewEvaluator

func NewEvaluator(ctx context.Context, log *logx.Log, estimator Manager, state allocation.PodSlice) (e *Evaluator)

func (*Evaluator) Allocate

func (e *Evaluator) Allocate(pod *manifest.Pod, env map[string]string)

Allocate providers in given pod

func (*Evaluator) Deallocate

func (e *Evaluator) Deallocate(name string)

Deallocate all providers in given pod

func (*Evaluator) GetConstraint

func (e *Evaluator) GetConstraint(pod *manifest.Pod) manifest.Constraint

Returns base constraint from manifest. For pods without resources GetConstraint adds constraint "__provider.allocate = false".

func (*Evaluator) Open

func (e *Evaluator) Open() (err error)

type Manager

type Manager interface {

	// Create provider
	CreateProvider(id string, alloc *allocation.Provider)

	// Update provider
	UpdateProvider(id string, alloc *allocation.Provider)

	// Deallocate provider on estimator
	DestroyProvider(id string)
}

Manager can reconfigure resources from providers

Jump to

Keyboard shortcuts

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