Documentation ¶
Overview ¶
Package registrytest provides tests for Registry implementations for storing Nodes, Pods, Schedulers and Services.
Index ¶
- func AssertCategories(t *testing.T, storage rest.CategoriesProvider, expected []string)
- func AssertShortNames(t *testing.T, storage rest.ShortNamesProvider, expected []string)
- func MakeNodeList(nodes []string, nodeResources api.NodeResources) *api.NodeList
- func NewEtcdStorage(t *testing.T, group string) (*storagebackend.Config, *etcdtesting.EtcdTestServer)
- func ValidateStorageStrategies(storageMap map[string]rest.Storage, exceptions StrategyExceptions) []error
- type EndpointRegistry
- func (e *EndpointRegistry) DeleteEndpoints(ctx context.Context, name string) error
- func (e *EndpointRegistry) GetEndpoints(ctx context.Context, name string, options *metav1.GetOptions) (*api.Endpoints, error)
- func (e *EndpointRegistry) ListEndpoints(ctx context.Context, options *metainternalversion.ListOptions) (*api.EndpointsList, error)
- func (e *EndpointRegistry) UpdateEndpoints(ctx context.Context, endpoints *api.Endpoints, ...) error
- func (e *EndpointRegistry) WatchEndpoints(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
- type NodeRegistry
- func (r *NodeRegistry) CreateNode(ctx context.Context, node *api.Node) error
- func (r *NodeRegistry) DeleteNode(ctx context.Context, nodeID string) error
- func (r *NodeRegistry) GetNode(ctx context.Context, nodeID string, options *metav1.GetOptions) (*api.Node, error)
- func (r *NodeRegistry) ListNodes(ctx context.Context, options *metainternalversion.ListOptions) (*api.NodeList, error)
- func (r *NodeRegistry) SetError(err error)
- func (r *NodeRegistry) UpdateNode(ctx context.Context, node *api.Node) error
- func (r *NodeRegistry) WatchNodes(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
- type ServiceRegistry
- func (r *ServiceRegistry) CreateService(ctx context.Context, svc *api.Service, ...) (*api.Service, error)
- func (r *ServiceRegistry) DeleteService(ctx context.Context, id string) error
- func (r *ServiceRegistry) ExportService(ctx context.Context, name string, options metav1.ExportOptions) (*api.Service, error)
- func (r *ServiceRegistry) GetService(ctx context.Context, id string, options *metav1.GetOptions) (*api.Service, error)
- func (r *ServiceRegistry) ListServices(ctx context.Context, options *metainternalversion.ListOptions) (*api.ServiceList, error)
- func (r *ServiceRegistry) SetError(err error)
- func (r *ServiceRegistry) UpdateService(ctx context.Context, svc *api.Service, ...) (*api.Service, error)
- func (r *ServiceRegistry) WatchServices(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
- type StrategyExceptions
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.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) (*storagebackend.Config, *etcdtesting.EtcdTestServer)
func ValidateStorageStrategies ¶ added in v1.8.0
func ValidateStorageStrategies(storageMap map[string]rest.Storage, exceptions StrategyExceptions) []error
ValidateStorageStrategies ensures any instances of the generic registry.Store in the given storage map have expected strategies defined.
Types ¶
type EndpointRegistry ¶
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 ¶
func (e *EndpointRegistry) DeleteEndpoints(ctx context.Context, name string) error
func (*EndpointRegistry) GetEndpoints ¶
func (e *EndpointRegistry) GetEndpoints(ctx context.Context, name string, options *metav1.GetOptions) (*api.Endpoints, error)
func (*EndpointRegistry) ListEndpoints ¶
func (e *EndpointRegistry) ListEndpoints(ctx context.Context, options *metainternalversion.ListOptions) (*api.EndpointsList, error)
func (*EndpointRegistry) UpdateEndpoints ¶
func (e *EndpointRegistry) UpdateEndpoints(ctx context.Context, endpoints *api.Endpoints, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc) error
func (*EndpointRegistry) WatchEndpoints ¶
func (e *EndpointRegistry) WatchEndpoints(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
type NodeRegistry ¶ added in v1.1.0
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 (*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 (*NodeRegistry) WatchNodes ¶ added in v1.1.0
func (r *NodeRegistry) WatchNodes(ctx context.Context, options *metainternalversion.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 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) ExportService ¶ added in v1.2.0
func (r *ServiceRegistry) ExportService(ctx context.Context, name string, options metav1.ExportOptions) (*api.Service, error)
func (*ServiceRegistry) GetService ¶
func (r *ServiceRegistry) GetService(ctx context.Context, id string, options *metav1.GetOptions) (*api.Service, error)
func (*ServiceRegistry) ListServices ¶
func (r *ServiceRegistry) ListServices(ctx context.Context, options *metainternalversion.ListOptions) (*api.ServiceList, error)
func (*ServiceRegistry) SetError ¶
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 ¶
func (r *ServiceRegistry) WatchServices(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
type StrategyExceptions ¶ added in v1.8.0
type StrategyExceptions struct { // HasExportStrategy is a list of the resource keys whose store should have a custom export strategy. HasExportStrategy []string }
StrategyExceptions carries information on what exceptions to default strategy expectations are expected.
Click to show internal directories.
Click to hide internal directories.