kubernetes: k8s.io/kubernetes/pkg/registry/registrytest Index | Files

package registrytest

import "k8s.io/kubernetes/pkg/registry/registrytest"

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

Index

Package Files

categoriesProvider.go doc.go endpoint.go etcd.go node.go service.go shortNamesProvider.go validate.go

func AssertCategories Uses

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

func AssertShortNames Uses

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

func MakeNodeList Uses

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

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

func NewEtcdStorage Uses

func NewEtcdStorage(t *testing.T, group string) (*storagebackend.Config, *etcd3testing.EtcdTestServer)

func NewEtcdStorageForResource Uses

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

func ValidateStorageStrategies Uses

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.

type EndpointRegistry Uses

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 Uses

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

func (*EndpointRegistry) Delete Uses

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

func (*EndpointRegistry) DeleteCollection Uses

func (e *EndpointRegistry) DeleteCollection(ctx context.Context, _ rest.ValidateObjectFunc, _ *metav1.DeleteOptions, _ *metainternalversion.ListOptions) (runtime.Object, error)

func (*EndpointRegistry) Get Uses

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

func (*EndpointRegistry) List Uses

func (e *EndpointRegistry) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error)

func (*EndpointRegistry) New Uses

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

func (*EndpointRegistry) NewList Uses

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

func (*EndpointRegistry) Update Uses

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 Uses

func (e *EndpointRegistry) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error)

type NodeRegistry Uses

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

    sync.Mutex
}

NodeRegistry implements node.Registry interface.

func NewNodeRegistry Uses

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

func (*NodeRegistry) CreateNode Uses

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

func (*NodeRegistry) DeleteNode Uses

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

func (*NodeRegistry) GetNode Uses

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

func (*NodeRegistry) ListNodes Uses

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

func (*NodeRegistry) SetError Uses

func (r *NodeRegistry) SetError(err error)

func (*NodeRegistry) UpdateNode Uses

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

func (*NodeRegistry) WatchNodes Uses

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

type ServiceRegistry Uses

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 Uses

func NewServiceRegistry() *ServiceRegistry

func (*ServiceRegistry) CreateService Uses

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

func (*ServiceRegistry) DeleteService Uses

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

func (*ServiceRegistry) ExportService Uses

func (r *ServiceRegistry) ExportService(ctx context.Context, name string, options metav1.ExportOptions) (*api.Service, error)

func (*ServiceRegistry) GetService Uses

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

func (*ServiceRegistry) ListServices Uses

func (r *ServiceRegistry) ListServices(ctx context.Context, options *metainternalversion.ListOptions) (*api.ServiceList, error)

func (*ServiceRegistry) SetError Uses

func (r *ServiceRegistry) SetError(err error)

func (*ServiceRegistry) UpdateService Uses

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

func (*ServiceRegistry) WatchServices Uses

func (r *ServiceRegistry) WatchServices(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error)

type StrategyExceptions Uses

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.

Package registrytest imports 22 packages (graph) and is imported by 37 packages. Updated 2019-07-19. Refresh now. Tools for package owners.