Rename storage interfaces
This commit is contained in:
@@ -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{} },
|
||||
|
||||
|
@@ -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())
|
||||
|
@@ -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{
|
||||
|
@@ -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())
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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{
|
||||
|
@@ -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.
|
||||
|
@@ -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{
|
||||
|
@@ -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{} },
|
||||
|
@@ -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())
|
||||
|
@@ -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{} },
|
||||
|
@@ -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
|
||||
|
@@ -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{} },
|
||||
|
@@ -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())
|
||||
|
@@ -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{} },
|
||||
|
@@ -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())
|
||||
|
@@ -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{} },
|
||||
|
@@ -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
|
||||
|
@@ -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{} },
|
||||
|
@@ -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())
|
||||
|
@@ -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{} },
|
||||
|
@@ -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
|
||||
|
@@ -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{
|
||||
|
@@ -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())
|
||||
|
@@ -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,
|
||||
|
@@ -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())
|
||||
|
@@ -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())
|
||||
|
@@ -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{} },
|
||||
|
@@ -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())
|
||||
|
Reference in New Issue
Block a user