registrytest

package
v1.3.6-beta.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2016 License: Apache-2.0 Imports: 19 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 MakeNodeList added in v1.1.0

func MakeNodeList(nodes []string, nodeResources api.NodeResources) *api.NodeList

MakeNodeList constructs api.NodeList from list of node names and a NodeResource.

func NewEtcdStorage added in v1.1.0

func NewEtcdStorage(t *testing.T, group string) (storage.Interface, *etcdtesting.EtcdTestServer)

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, options *api.ListOptions) (*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, options *api.ListOptions) (watch.Interface, error)

type NodeRegistry added in v1.1.0

type NodeRegistry struct {
	Err   error
	Node  string
	Nodes api.NodeList

	sync.Mutex
}

NodeRegistry implements node.Registry interface.

func NewNodeRegistry added in v1.1.0

func NewNodeRegistry(nodes []string, nodeResources api.NodeResources) *NodeRegistry

func (*NodeRegistry) CreateNode added in v1.1.0

func (r *NodeRegistry) CreateNode(ctx api.Context, node *api.Node) error

func (*NodeRegistry) DeleteNode added in v1.1.0

func (r *NodeRegistry) DeleteNode(ctx api.Context, nodeID string) error

func (*NodeRegistry) GetNode added in v1.1.0

func (r *NodeRegistry) GetNode(ctx api.Context, nodeID string) (*api.Node, error)

func (*NodeRegistry) ListNodes added in v1.1.0

func (r *NodeRegistry) ListNodes(ctx api.Context, options *api.ListOptions) (*api.NodeList, error)

func (*NodeRegistry) SetError added in v1.1.0

func (r *NodeRegistry) SetError(err error)

func (*NodeRegistry) UpdateNode added in v1.1.0

func (r *NodeRegistry) UpdateNode(ctx api.Context, node *api.Node) error

func (*NodeRegistry) WatchNodes added in v1.1.0

func (r *NodeRegistry) WatchNodes(ctx api.Context, options *api.ListOptions) (watch.Interface, error)

type ServiceRegistry

type ServiceRegistry struct {
	List    api.ServiceList
	Service *api.Service
	Updates []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) ExportService added in v1.2.0

func (r *ServiceRegistry) ExportService(ctx api.Context, name string, options unversioned.ExportOptions) (*api.Service, 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, options *api.ListOptions) (*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, options *api.ListOptions) (watch.Interface, error)

type Tester added in v1.1.0

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

func New added in v1.1.0

func New(t *testing.T, storage *registry.Store) *Tester

func (*Tester) AllowCreateOnUpdate added in v1.1.0

func (t *Tester) AllowCreateOnUpdate() *Tester

func (*Tester) ClusterScope added in v1.1.0

func (t *Tester) ClusterScope() *Tester

func (*Tester) GeneratesName added in v1.1.0

func (t *Tester) GeneratesName() *Tester

func (*Tester) Namer added in v1.3.0

func (t *Tester) Namer(namer func(int) string) *Tester

func (*Tester) ReturnDeletedObject added in v1.1.0

func (t *Tester) ReturnDeletedObject() *Tester

func (*Tester) TestCreate added in v1.1.0

func (t *Tester) TestCreate(valid runtime.Object, invalid ...runtime.Object)

func (*Tester) TestDelete added in v1.1.0

func (t *Tester) TestDelete(valid runtime.Object)

func (*Tester) TestDeleteGraceful added in v1.1.0

func (t *Tester) TestDeleteGraceful(valid runtime.Object, expectedGrace int64)

func (*Tester) TestGet added in v1.1.0

func (t *Tester) TestGet(valid runtime.Object)

func (*Tester) TestList added in v1.1.0

func (t *Tester) TestList(valid runtime.Object)

func (*Tester) TestNamespace added in v1.1.0

func (t *Tester) TestNamespace() string

func (*Tester) TestUpdate added in v1.1.0

func (t *Tester) TestUpdate(valid runtime.Object, validUpdateFunc UpdateFunc, invalidUpdateFunc ...UpdateFunc)

func (*Tester) TestWatch added in v1.1.0

func (t *Tester) TestWatch(valid runtime.Object, labelsPass, labelsFail []labels.Set, fieldsPass, fieldsFail []fields.Set)

type UpdateFunc added in v1.1.0

type UpdateFunc func(runtime.Object) runtime.Object

Jump to

Keyboard shortcuts

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