registrytest

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package registrytest provides tests for Registry implementations for storing Minions, Pods, Schedulers and Services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeMinionList

func MakeMinionList(minions []string, nodeResources api.NodeResources) *api.NodeList

MakeMinionList constructs api.MinionList from list of minion names and a NodeResource.

Types

type ControllerRegistry

type ControllerRegistry struct {
	Err         error
	Controllers *api.ReplicationControllerList
	sync.Mutex
}

TODO: Why do we have this AND MemoryRegistry?

func (*ControllerRegistry) CreateController

func (r *ControllerRegistry) CreateController(ctx api.Context, controller *api.ReplicationController) (*api.ReplicationController, error)

func (*ControllerRegistry) DeleteController

func (r *ControllerRegistry) DeleteController(ctx api.Context, ID string) error

func (*ControllerRegistry) GetController

func (r *ControllerRegistry) GetController(ctx api.Context, ID string) (*api.ReplicationController, error)

func (*ControllerRegistry) ListControllers

func (r *ControllerRegistry) ListControllers(ctx api.Context) (*api.ReplicationControllerList, error)

func (*ControllerRegistry) SetError added in v0.10.0

func (r *ControllerRegistry) SetError(err error)

func (*ControllerRegistry) UpdateController

func (r *ControllerRegistry) UpdateController(ctx api.Context, controller *api.ReplicationController) (*api.ReplicationController, error)

func (*ControllerRegistry) WatchControllers

func (r *ControllerRegistry) WatchControllers(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)

type EndpointRegistry added in v0.13.0

type EndpointRegistry struct {
	Endpoints *api.EndpointsList
	Updates   []api.Endpoints
	Err       error
	// contains filtered or unexported fields
}

Registry is an interface for things that know how to store endpoints.

func (*EndpointRegistry) DeleteEndpoints added in v0.14.0

func (e *EndpointRegistry) DeleteEndpoints(ctx api.Context, name string) error

func (*EndpointRegistry) GetEndpoints added in v0.13.0

func (e *EndpointRegistry) GetEndpoints(ctx api.Context, name string) (*api.Endpoints, error)

func (*EndpointRegistry) ListEndpoints added in v0.13.0

func (e *EndpointRegistry) ListEndpoints(ctx api.Context) (*api.EndpointsList, error)

func (*EndpointRegistry) UpdateEndpoints added in v0.13.0

func (e *EndpointRegistry) UpdateEndpoints(ctx api.Context, endpoints *api.Endpoints) error

func (*EndpointRegistry) WatchEndpoints added in v0.13.0

func (e *EndpointRegistry) WatchEndpoints(ctx api.Context, labels labels.Selector, fields fields.Selector, resourceVersion string) (watch.Interface, error)

type GenericRegistry

type GenericRegistry struct {
	Err        error
	Object     runtime.Object
	ObjectList runtime.Object
	sync.Mutex

	Broadcaster *watch.Broadcaster
}

GenericRegistry knows how to store & list any runtime.Object.

func NewGeneric

func NewGeneric(list runtime.Object) *GenericRegistry

func (*GenericRegistry) CreateWithName added in v0.11.0

func (r *GenericRegistry) CreateWithName(ctx api.Context, id string, obj runtime.Object) error

func (*GenericRegistry) Delete

func (r *GenericRegistry) Delete(ctx api.Context, id string, options *api.DeleteOptions) (runtime.Object, error)

func (*GenericRegistry) Get

func (r *GenericRegistry) Get(ctx api.Context, id string) (runtime.Object, error)

func (*GenericRegistry) ListPredicate added in v0.13.0

func (r *GenericRegistry) ListPredicate(ctx api.Context, m generic.Matcher) (runtime.Object, error)

func (*GenericRegistry) UpdateWithName added in v0.11.0

func (r *GenericRegistry) UpdateWithName(ctx api.Context, id string, obj runtime.Object) error

func (*GenericRegistry) WatchPredicate added in v0.13.0

func (r *GenericRegistry) WatchPredicate(ctx api.Context, m generic.Matcher, resourceVersion string) (watch.Interface, error)

type MinionRegistry

type MinionRegistry struct {
	Err     error
	Minion  string
	Minions api.NodeList

	sync.Mutex
}

MinionRegistry implements minion.Registry interface.

func NewMinionRegistry

func NewMinionRegistry(minions []string, nodeResources api.NodeResources) *MinionRegistry

func (*MinionRegistry) CreateMinion

func (r *MinionRegistry) CreateMinion(ctx api.Context, minion *api.Node) error

func (*MinionRegistry) DeleteMinion

func (r *MinionRegistry) DeleteMinion(ctx api.Context, minionID string) error

func (*MinionRegistry) GetMinion

func (r *MinionRegistry) GetMinion(ctx api.Context, minionID string) (*api.Node, error)

func (*MinionRegistry) ListMinions

func (r *MinionRegistry) ListMinions(ctx api.Context, label labels.Selector, field fields.Selector) (*api.NodeList, error)

func (*MinionRegistry) SetError added in v0.10.0

func (r *MinionRegistry) SetError(err error)

func (*MinionRegistry) UpdateMinion added in v0.5.1

func (r *MinionRegistry) UpdateMinion(ctx api.Context, minion *api.Node) error

func (*MinionRegistry) WatchMinions added in v0.8.0

func (r *MinionRegistry) WatchMinions(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)

type PodRegistry

type PodRegistry struct {
	Err  error
	Pod  *api.Pod
	Pods *api.PodList
	sync.Mutex
	// contains filtered or unexported fields
}

func NewPodRegistry

func NewPodRegistry(pods *api.PodList) *PodRegistry

func (*PodRegistry) CreatePod

func (r *PodRegistry) CreatePod(ctx api.Context, pod *api.Pod) error

func (*PodRegistry) DeletePod

func (r *PodRegistry) DeletePod(ctx api.Context, podId string) error

func (*PodRegistry) GetPod

func (r *PodRegistry) GetPod(ctx api.Context, podId string) (*api.Pod, error)

func (*PodRegistry) ListPods

func (r *PodRegistry) ListPods(ctx api.Context, selector labels.Selector) (*api.PodList, error)

func (*PodRegistry) ListPodsPredicate

func (r *PodRegistry) ListPodsPredicate(ctx api.Context, filter func(*api.Pod) bool) (*api.PodList, error)

func (*PodRegistry) SetError added in v0.10.0

func (r *PodRegistry) SetError(err error)

func (*PodRegistry) UpdatePod

func (r *PodRegistry) UpdatePod(ctx api.Context, pod *api.Pod) error

func (*PodRegistry) WatchPods

func (r *PodRegistry) WatchPods(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)

type Scheduler

type Scheduler struct {
	Err     error
	Pod     *api.Pod
	Machine string
}

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(pod *api.Pod, lister algorithm.MinionLister) (string, error)

type ServiceRegistry

type ServiceRegistry struct {
	List    api.ServiceList
	Service *api.Service
	Err     error

	DeletedID string
	GottenID  string
	UpdatedID string
	// contains filtered or unexported fields
}

func NewServiceRegistry

func NewServiceRegistry() *ServiceRegistry

func (*ServiceRegistry) CreateService

func (r *ServiceRegistry) CreateService(ctx api.Context, svc *api.Service) (*api.Service, error)

func (*ServiceRegistry) DeleteService

func (r *ServiceRegistry) DeleteService(ctx api.Context, id string) error

func (*ServiceRegistry) GetService

func (r *ServiceRegistry) GetService(ctx api.Context, id string) (*api.Service, error)

func (*ServiceRegistry) ListServices

func (r *ServiceRegistry) ListServices(ctx api.Context) (*api.ServiceList, error)

func (*ServiceRegistry) SetError added in v0.10.0

func (r *ServiceRegistry) SetError(err error)

func (*ServiceRegistry) UpdateService

func (r *ServiceRegistry) UpdateService(ctx api.Context, svc *api.Service) (*api.Service, error)

func (*ServiceRegistry) WatchServices

func (r *ServiceRegistry) WatchServices(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)

Jump to

Keyboard shortcuts

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