Rename storage interfaces

This commit is contained in:
Wojciech Tyczynski
2015-07-30 09:45:06 +02:00
parent d17985f1ad
commit 99d6b0e9f4
39 changed files with 84 additions and 84 deletions

View File

@@ -37,7 +37,7 @@ type REST struct {
var controllerPrefix = "/controllers"
// NewREST returns a RESTStorage object that will work against replication controllers.
func NewREST(s storage.StorageInterface) *REST {
func NewREST(s storage.Interface) *REST {
store := &etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &api.ReplicationController{} },

View File

@@ -41,7 +41,7 @@ const (
FAIL
)
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.StorageInterface) {
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())

View File

@@ -33,7 +33,7 @@ type REST struct {
}
// NewStorage returns a RESTStorage object that will work against endpoints.
func NewStorage(s storage.StorageInterface) *REST {
func NewStorage(s storage.Interface) *REST {
prefix := "/services/endpoints"
return &REST{
&etcdgeneric.Etcd{

View File

@@ -33,7 +33,7 @@ import (
"github.com/coreos/go-etcd/etcd"
)
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.StorageInterface) {
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())

View File

@@ -45,17 +45,17 @@ const (
// Registry implements BindingRegistry, ControllerRegistry, EndpointRegistry,
// MinionRegistry, PodRegistry and ServiceRegistry, backed by etcd.
type Registry struct {
storage.StorageInterface
storage.Interface
pods pod.Registry
endpoints endpoint.Registry
}
// NewRegistry creates an etcd registry.
func NewRegistry(storage storage.StorageInterface, pods pod.Registry, endpoints endpoint.Registry) *Registry {
func NewRegistry(storage storage.Interface, pods pod.Registry, endpoints endpoint.Registry) *Registry {
registry := &Registry{
StorageInterface: storage,
pods: pods,
endpoints: endpoints,
Interface: storage,
pods: pods,
endpoints: endpoints,
}
return registry
}

View File

@@ -31,7 +31,7 @@ type registry struct {
// NewEtcdRegistry returns a registry which will store Events in the given
// EtcdStorage. ttl is the time that Events will be retained by the system.
func NewEtcdRegistry(s storage.StorageInterface, ttl uint64) generic.Registry {
func NewEtcdRegistry(s storage.Interface, ttl uint64) generic.Registry {
prefix := "/events"
return registry{
Etcd: &etcdgeneric.Etcd{

View File

@@ -104,7 +104,7 @@ type Etcd struct {
ReturnDeletedObject bool
// Used for all etcd access functions
Storage storage.StorageInterface
Storage storage.Interface
}
// NamespaceKeyRootFunc is the default function for constructing etcd paths to resource directories enforcing namespace rules.

View File

@@ -30,7 +30,7 @@ type registry struct {
}
// NewEtcdRegistry returns a registry which will store LimitRange in the given storage
func NewEtcdRegistry(s storage.StorageInterface) generic.Registry {
func NewEtcdRegistry(s storage.Interface) generic.Registry {
prefix := "/limitranges"
return registry{
Etcd: &etcdgeneric.Etcd{

View File

@@ -49,7 +49,7 @@ func (r *StatusREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object
}
// NewStorage returns a RESTStorage object that will work against nodes.
func NewStorage(s storage.StorageInterface, connection client.ConnectionInfoGetter) (*REST, *StatusREST) {
func NewStorage(s storage.Interface, connection client.ConnectionInfoGetter) (*REST, *StatusREST) {
prefix := "/minions"
store := &etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &api.Node{} },

View File

@@ -48,7 +48,7 @@ func (fakeConnectionInfoGetter) GetConnectionInfo(host string) (string, uint, ht
return "http", 12345, nil, nil
}
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.StorageInterface) {
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())

View File

@@ -49,7 +49,7 @@ type FinalizeREST struct {
}
// NewStorage returns a RESTStorage object that will work against namespaces
func NewStorage(s storage.StorageInterface) (*REST, *StatusREST, *FinalizeREST) {
func NewStorage(s storage.Interface) (*REST, *StatusREST, *FinalizeREST) {
prefix := "/namespaces"
store := &etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &api.Namespace{} },

View File

@@ -34,14 +34,14 @@ import (
"github.com/coreos/go-etcd/etcd"
)
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.StorageInterface) {
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())
return fakeEtcdClient, etcdStorage
}
func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient, storage.StorageInterface) {
func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient, s := newEtcdStorage(t)
storage, _, _ := NewStorage(s)
return storage, fakeEtcdClient, s

View File

@@ -35,7 +35,7 @@ type REST struct {
}
// NewREST returns a RESTStorage object that will work against PersistentVolume objects.
func NewStorage(s storage.StorageInterface) (*REST, *StatusREST) {
func NewStorage(s storage.Interface) (*REST, *StatusREST) {
prefix := "/persistentvolumes"
store := &etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &api.PersistentVolume{} },

View File

@@ -39,7 +39,7 @@ type testRegistry struct {
*registrytest.GenericRegistry
}
func newStorage(t *testing.T) (*REST, *StatusREST, *tools.FakeEtcdClient, storage.StorageInterface) {
func newStorage(t *testing.T) (*REST, *StatusREST, *tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())

View File

@@ -33,7 +33,7 @@ type REST struct {
}
// NewREST returns a RESTStorage object that will work against PersistentVolumeClaim objects.
func NewStorage(s storage.StorageInterface) (*REST, *StatusREST) {
func NewStorage(s storage.Interface) (*REST, *StatusREST) {
prefix := "/persistentvolumeclaims"
store := &etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &api.PersistentVolumeClaim{} },

View File

@@ -39,7 +39,7 @@ type testRegistry struct {
*registrytest.GenericRegistry
}
func newStorage(t *testing.T) (*REST, *StatusREST, *tools.FakeEtcdClient, storage.StorageInterface) {
func newStorage(t *testing.T) (*REST, *StatusREST, *tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())

View File

@@ -57,7 +57,7 @@ type REST struct {
}
// NewStorage returns a RESTStorage object that will work against pods.
func NewStorage(s storage.StorageInterface, k client.ConnectionInfoGetter) PodStorage {
func NewStorage(s storage.Interface, k client.ConnectionInfoGetter) PodStorage {
prefix := "/pods"
store := &etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &api.Pod{} },

View File

@@ -41,14 +41,14 @@ import (
"github.com/coreos/go-etcd/etcd"
)
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.StorageInterface) {
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())
return fakeEtcdClient, etcdStorage
}
func newStorage(t *testing.T) (*REST, *BindingREST, *StatusREST, *tools.FakeEtcdClient, storage.StorageInterface) {
func newStorage(t *testing.T) (*REST, *BindingREST, *StatusREST, *tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient, etcdStorage := newEtcdStorage(t)
storage := NewStorage(etcdStorage, nil)
return storage.Pod, storage.Binding, storage.Status, fakeEtcdClient, etcdStorage

View File

@@ -33,7 +33,7 @@ type REST struct {
}
// NewREST returns a RESTStorage object that will work against pod templates.
func NewREST(s storage.StorageInterface) *REST {
func NewREST(s storage.Interface) *REST {
prefix := "/podtemplates"
store := etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &api.PodTemplate{} },

View File

@@ -27,7 +27,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools/etcdtest"
)
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.StorageInterface) {
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, testapi.Codec(), etcdtest.PathPrefix())

View File

@@ -33,7 +33,7 @@ type REST struct {
}
// NewStorage returns a RESTStorage object that will work against ResourceQuota objects.
func NewStorage(s storage.StorageInterface) (*REST, *StatusREST) {
func NewStorage(s storage.Interface) (*REST, *StatusREST) {
prefix := "/resourcequotas"
store := &etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &api.ResourceQuota{} },

View File

@@ -39,14 +39,14 @@ import (
"github.com/coreos/go-etcd/etcd"
)
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.StorageInterface) {
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())
return fakeEtcdClient, etcdStorage
}
func newStorage(t *testing.T) (*REST, *StatusREST, *tools.FakeEtcdClient, storage.StorageInterface) {
func newStorage(t *testing.T) (*REST, *StatusREST, *tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient, h := newEtcdStorage(t)
storage, statusStorage := NewStorage(h)
return storage, statusStorage, fakeEtcdClient, h

View File

@@ -33,7 +33,7 @@ type REST struct {
}
// NewStorage returns a registry which will store Secret in the given etcdStorage
func NewStorage(s storage.StorageInterface) *REST {
func NewStorage(s storage.Interface) *REST {
prefix := "/secrets"
store := &etcdgeneric.Etcd{

View File

@@ -27,7 +27,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools/etcdtest"
)
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.StorageInterface) {
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, testapi.Codec(), etcdtest.PathPrefix())

View File

@@ -43,7 +43,7 @@ type Etcd struct {
lock sync.Mutex
alloc allocator.Snapshottable
storage storage.StorageInterface
storage storage.Interface
last string
baseKey string
@@ -56,7 +56,7 @@ var _ service.RangeRegistry = &Etcd{}
// NewEtcd returns an allocator that is backed by Etcd and can manage
// persisting the snapshot state of allocation after each allocation is made.
func NewEtcd(alloc allocator.Snapshottable, baseKey string, kind string, storage storage.StorageInterface) *Etcd {
func NewEtcd(alloc allocator.Snapshottable, baseKey string, kind string, storage storage.Interface) *Etcd {
return &Etcd{
alloc: alloc,
storage: storage,

View File

@@ -31,7 +31,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools/etcdtest"
)
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.StorageInterface) {
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, testapi.Codec(), etcdtest.PathPrefix())

View File

@@ -34,7 +34,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools/etcdtest"
)
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.StorageInterface) {
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, testapi.Codec(), etcdtest.PathPrefix())

View File

@@ -35,7 +35,7 @@ type REST struct {
const Prefix = "/serviceaccounts"
// NewStorage returns a RESTStorage object that will work against service accounts objects.
func NewStorage(s storage.StorageInterface) *REST {
func NewStorage(s storage.Interface) *REST {
store := &etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &api.ServiceAccount{} },
NewListFunc: func() runtime.Object { return &api.ServiceAccountList{} },

View File

@@ -27,7 +27,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools/etcdtest"
)
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.StorageInterface) {
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, storage.Interface) {
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeEtcdClient.TestIndex = true
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, testapi.Codec(), etcdtest.PathPrefix())