mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 22:20:51 +00:00
Rename NewREST -> NewStorage to align on terminology
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
@@ -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{
|
||||
|
Reference in New Issue
Block a user