registrytest

package
v1.32.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 20 Imported by: 73

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertCategories added in v1.7.0

func AssertCategories(t *testing.T, storage rest.CategoriesProvider, expected []string)

func AssertShortNames added in v1.6.0

func AssertShortNames(t *testing.T, storage rest.ShortNamesProvider, expected []string)

func MakeNodeList added in v1.1.0

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

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

func NewEtcdStorage added in v1.1.0

NewEtcdStorage is for testing. It configures the etcd storage for a bogus resource; the test must not care.

func NewEtcdStorageForResource added in v1.15.0

func NewEtcdStorageForResource(t *testing.T, resource schema.GroupResource) (*storagebackend.ConfigForResource, *etcd3testing.EtcdTestServer)

func ValidateStorageStrategies added in v1.8.0

func ValidateStorageStrategies(storageMap map[string]rest.Storage) []error

ValidateStorageStrategies ensures any instances of the generic registry.Store in the given storage map have expected strategies defined.

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) Create added in v1.12.0

func (e *EndpointRegistry) Create(ctx context.Context, endpoints runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error)

func (*EndpointRegistry) Delete added in v1.12.0

func (e *EndpointRegistry) Delete(ctx context.Context, name string, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions) (runtime.Object, bool, error)

func (*EndpointRegistry) DeleteCollection added in v1.12.0

func (*EndpointRegistry) Get added in v1.12.0

func (e *EndpointRegistry) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

func (*EndpointRegistry) List added in v1.12.0

func (*EndpointRegistry) New added in v1.12.0

func (e *EndpointRegistry) New() runtime.Object

func (*EndpointRegistry) NewList added in v1.12.0

func (e *EndpointRegistry) NewList() runtime.Object

func (*EndpointRegistry) Update added in v1.12.0

func (e *EndpointRegistry) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreateOnUpdate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

func (*EndpointRegistry) Watch added in v1.12.0

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 (*NodeRegistry) CreateNode added in v1.1.0

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

func (*NodeRegistry) DeleteNode added in v1.1.0

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

func (*NodeRegistry) GetNode added in v1.1.0

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

func (*NodeRegistry) ListNodes added in v1.1.0

func (r *NodeRegistry) ListNodes(ctx context.Context, options *metainternalversion.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 context.Context, node *api.Node) error

func (*NodeRegistry) WatchNodes added in v1.1.0

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 (*ServiceRegistry) CreateService

func (r *ServiceRegistry) CreateService(ctx context.Context, svc *api.Service, createValidation rest.ValidateObjectFunc) (*api.Service, error)

func (*ServiceRegistry) DeleteService

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

func (*ServiceRegistry) GetService

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

func (*ServiceRegistry) ListServices

func (*ServiceRegistry) SetError added in v0.10.0

func (r *ServiceRegistry) SetError(err error)

func (*ServiceRegistry) UpdateService

func (r *ServiceRegistry) UpdateService(ctx context.Context, svc *api.Service, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc) (*api.Service, error)

func (*ServiceRegistry) WatchServices

Jump to

Keyboard shortcuts

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