registrytest

package
v1.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: Apache-2.0 Imports: 15 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 GetObject

func GetObject(fakeClient *tools.FakeEtcdClient, keyFn keyFunc, newFn newFunc, ctx api.Context, obj runtime.Object) (runtime.Object, error)

func MakeMinionList

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

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

func NewEtcdStorage added in v1.1.0

func NewEtcdStorage(t *testing.T) (storage.Interface, *tools.FakeEtcdClient)

func SetObject

func SetObject(fakeClient *tools.FakeEtcdClient, keyFn keyFunc, ctx api.Context, obj runtime.Object) error

func SetObjectsForKey

func SetObjectsForKey(fakeClient *tools.FakeEtcdClient, key string, objects []runtime.Object) []runtime.Object

func SetResourceVersion

func SetResourceVersion(fakeClient *tools.FakeEtcdClient, resourceVersion uint64)

Types

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 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 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, label labels.Selector, field fields.Selector) (*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