Rename NewREST -> NewStorage to align on terminology

This commit is contained in:
Clayton Coleman
2015-03-21 12:32:31 -04:00
parent 5a3f0adbcc
commit 9bb797fe93
21 changed files with 100 additions and 100 deletions

View File

@@ -38,8 +38,8 @@ type REST struct {
registry Registry
}
// NewREST returns a new rest.Storage implementation for minion.
func NewREST(m Registry) *REST {
// NewStorage returns a new rest.Storage implementation for minion.
func NewStorage(m Registry) *REST {
return &REST{
registry: m,
}

View File

@@ -28,7 +28,7 @@ import (
)
func TestMinionRegistryREST(t *testing.T) {
ms := NewREST(registrytest.NewMinionRegistry([]string{"foo", "bar"}, api.NodeResources{}))
ms := NewStorage(registrytest.NewMinionRegistry([]string{"foo", "bar"}, api.NodeResources{}))
ctx := api.NewContext()
if obj, err := ms.Get(ctx, "foo"); err != nil || obj.(*api.Node).Name != "foo" {
t.Errorf("missing expected object")
@@ -88,7 +88,7 @@ func TestMinionRegistryREST(t *testing.T) {
}
func TestMinionRegistryValidUpdate(t *testing.T) {
storage := NewREST(registrytest.NewMinionRegistry([]string{"foo", "bar"}, api.NodeResources{}))
storage := NewStorage(registrytest.NewMinionRegistry([]string{"foo", "bar"}, api.NodeResources{}))
ctx := api.NewContext()
obj, err := storage.Get(ctx, "foo")
if err != nil {
@@ -113,7 +113,7 @@ var (
)
func TestMinionRegistryValidatesCreate(t *testing.T) {
storage := NewREST(registrytest.NewMinionRegistry([]string{"foo", "bar"}, api.NodeResources{}))
storage := NewStorage(registrytest.NewMinionRegistry([]string{"foo", "bar"}, api.NodeResources{}))
ctx := api.NewContext()
failureCases := map[string]api.Node{
"zero-length Name": {
@@ -156,7 +156,7 @@ func contains(nodes *api.NodeList, nodeID string) bool {
func TestCreate(t *testing.T) {
registry := registrytest.NewMinionRegistry([]string{"foo", "bar"}, api.NodeResources{})
test := resttest.New(t, NewREST(registry), registry.SetError).ClusterScope()
test := resttest.New(t, NewStorage(registry), registry.SetError).ClusterScope()
test.TestCreate(
// valid
&api.Node{