Documentation ¶
Overview ¶
Package registrytest provides tests for Registry implementations for storing Nodes, Pods, Schedulers and Services.
Index ¶
- 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)
- type EndpointRegistry
- func (e *EndpointRegistry) DeleteEndpoints(ctx genericapirequest.Context, name string) error
- func (e *EndpointRegistry) GetEndpoints(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.Endpoints, error)
- func (e *EndpointRegistry) ListEndpoints(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.EndpointsList, error)
- func (e *EndpointRegistry) UpdateEndpoints(ctx genericapirequest.Context, endpoints *api.Endpoints) error
- func (e *EndpointRegistry) WatchEndpoints(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
- type NodeRegistry
- func (r *NodeRegistry) CreateNode(ctx genericapirequest.Context, node *api.Node) error
- func (r *NodeRegistry) DeleteNode(ctx genericapirequest.Context, nodeID string) error
- func (r *NodeRegistry) GetNode(ctx genericapirequest.Context, nodeID string, options *metav1.GetOptions) (*api.Node, error)
- func (r *NodeRegistry) ListNodes(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.NodeList, error)
- func (r *NodeRegistry) SetError(err error)
- func (r *NodeRegistry) UpdateNode(ctx genericapirequest.Context, node *api.Node) error
- func (r *NodeRegistry) WatchNodes(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
- type ServiceRegistry
- func (r *ServiceRegistry) CreateService(ctx genericapirequest.Context, svc *api.Service) (*api.Service, error)
- func (r *ServiceRegistry) DeleteService(ctx genericapirequest.Context, id string) error
- func (r *ServiceRegistry) ExportService(ctx genericapirequest.Context, name string, options metav1.ExportOptions) (*api.Service, error)
- func (r *ServiceRegistry) GetService(ctx genericapirequest.Context, id string, options *metav1.GetOptions) (*api.Service, error)
- func (r *ServiceRegistry) ListServices(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.ServiceList, error)
- func (r *ServiceRegistry) SetError(err error)
- func (r *ServiceRegistry) UpdateService(ctx genericapirequest.Context, svc *api.Service) (*api.Service, error)
- func (r *ServiceRegistry) WatchServices(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
- type Tester
- func (t *Tester) AllowCreateOnUpdate() *Tester
- func (t *Tester) ClusterScope() *Tester
- func (t *Tester) GeneratesName() *Tester
- func (t *Tester) Namer(namer func(int) string) *Tester
- func (t *Tester) ReturnDeletedObject() *Tester
- func (t *Tester) TestCreate(valid runtime.Object, invalid ...runtime.Object)
- func (t *Tester) TestDelete(valid runtime.Object)
- func (t *Tester) TestDeleteGraceful(valid runtime.Object, expectedGrace int64)
- func (t *Tester) TestGet(valid runtime.Object)
- func (t *Tester) TestList(valid runtime.Object)
- func (t *Tester) TestNamespace() string
- func (t *Tester) TestUpdate(valid runtime.Object, validUpdateFunc UpdateFunc, ...)
- func (t *Tester) TestWatch(valid runtime.Object, labelsPass, labelsFail []labels.Set, ...)
- type UpdateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertShortNames ¶ added in v1.6.0
func AssertShortNames(t *testing.T, storage rest.ShortNamesProvider, expected []string)
func MakeNodeList ¶ added in v1.1.6
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.6
func NewEtcdStorage(t *testing.T, group string) (*storagebackend.Config, *etcdtesting.EtcdTestServer)
Types ¶
type EndpointRegistry ¶ added in v0.13.1
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.2
func (e *EndpointRegistry) DeleteEndpoints(ctx genericapirequest.Context, name string) error
func (*EndpointRegistry) GetEndpoints ¶ added in v0.13.1
func (e *EndpointRegistry) GetEndpoints(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.Endpoints, error)
func (*EndpointRegistry) ListEndpoints ¶ added in v0.13.1
func (e *EndpointRegistry) ListEndpoints(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.EndpointsList, error)
func (*EndpointRegistry) UpdateEndpoints ¶ added in v0.13.1
func (e *EndpointRegistry) UpdateEndpoints(ctx genericapirequest.Context, endpoints *api.Endpoints) error
func (*EndpointRegistry) WatchEndpoints ¶ added in v0.13.1
func (e *EndpointRegistry) WatchEndpoints(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
type NodeRegistry ¶ added in v1.1.6
NodeRegistry implements node.Registry interface.
func NewNodeRegistry ¶ added in v1.1.6
func NewNodeRegistry(nodes []string, nodeResources api.NodeResources) *NodeRegistry
func (*NodeRegistry) CreateNode ¶ added in v1.1.6
func (r *NodeRegistry) CreateNode(ctx genericapirequest.Context, node *api.Node) error
func (*NodeRegistry) DeleteNode ¶ added in v1.1.6
func (r *NodeRegistry) DeleteNode(ctx genericapirequest.Context, nodeID string) error
func (*NodeRegistry) GetNode ¶ added in v1.1.6
func (r *NodeRegistry) GetNode(ctx genericapirequest.Context, nodeID string, options *metav1.GetOptions) (*api.Node, error)
func (*NodeRegistry) ListNodes ¶ added in v1.1.6
func (r *NodeRegistry) ListNodes(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.NodeList, error)
func (*NodeRegistry) SetError ¶ added in v1.1.6
func (r *NodeRegistry) SetError(err error)
func (*NodeRegistry) UpdateNode ¶ added in v1.1.6
func (r *NodeRegistry) UpdateNode(ctx genericapirequest.Context, node *api.Node) error
func (*NodeRegistry) WatchNodes ¶ added in v1.1.6
func (r *NodeRegistry) WatchNodes(ctx genericapirequest.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 genericapirequest.Context, svc *api.Service) (*api.Service, error)
func (*ServiceRegistry) DeleteService ¶
func (r *ServiceRegistry) DeleteService(ctx genericapirequest.Context, id string) error
func (*ServiceRegistry) ExportService ¶ added in v1.2.3
func (r *ServiceRegistry) ExportService(ctx genericapirequest.Context, name string, options metav1.ExportOptions) (*api.Service, error)
func (*ServiceRegistry) GetService ¶
func (r *ServiceRegistry) GetService(ctx genericapirequest.Context, id string, options *metav1.GetOptions) (*api.Service, error)
func (*ServiceRegistry) ListServices ¶
func (r *ServiceRegistry) ListServices(ctx genericapirequest.Context, options *metainternalversion.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 genericapirequest.Context, svc *api.Service) (*api.Service, error)
func (*ServiceRegistry) WatchServices ¶
func (r *ServiceRegistry) WatchServices(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
type Tester ¶ added in v1.1.6
type Tester struct {
// contains filtered or unexported fields
}
func (*Tester) AllowCreateOnUpdate ¶ added in v1.1.6
func (*Tester) ClusterScope ¶ added in v1.1.6
func (*Tester) GeneratesName ¶ added in v1.1.6
func (*Tester) ReturnDeletedObject ¶ added in v1.1.6
func (*Tester) TestCreate ¶ added in v1.1.6
func (*Tester) TestDelete ¶ added in v1.1.6
func (*Tester) TestDeleteGraceful ¶ added in v1.1.6
func (*Tester) TestNamespace ¶ added in v1.1.6
func (*Tester) TestUpdate ¶ added in v1.1.6
func (t *Tester) TestUpdate(valid runtime.Object, validUpdateFunc UpdateFunc, invalidUpdateFunc ...UpdateFunc)
Click to show internal directories.
Click to hide internal directories.