diff --git a/pkg/registry/namespace/registry.go b/pkg/registry/namespace/registry.go index 8301945df1b..c6aa5758313 100644 --- a/pkg/registry/namespace/registry.go +++ b/pkg/registry/namespace/registry.go @@ -21,7 +21,6 @@ import ( "github.com/GoogleCloudPlatform/kubernetes/pkg/api/rest" "github.com/GoogleCloudPlatform/kubernetes/pkg/fields" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" - "github.com/GoogleCloudPlatform/kubernetes/pkg/runtime" "github.com/GoogleCloudPlatform/kubernetes/pkg/watch" ) @@ -41,26 +40,14 @@ type Registry interface { DeleteNamespace(ctx api.Context, namespaceID string) error } -// Storage is an interface for a standard REST Storage backend -// TODO: move me somewhere common -type Storage interface { - rest.GracefulDeleter - rest.Lister - rest.Getter - rest.Watcher - - Create(ctx api.Context, obj runtime.Object) (runtime.Object, error) - Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error) -} - // storage puts strong typing around storage calls type storage struct { - Storage + rest.StandardStorage } // NewRegistry returns a new Registry interface for the given Storage. Any mismatched // types will panic. -func NewRegistry(s Storage) Registry { +func NewRegistry(s rest.StandardStorage) Registry { return &storage{s} } diff --git a/pkg/registry/pod/registry.go b/pkg/registry/pod/registry.go index f65aaa5690e..4be48ab56e9 100644 --- a/pkg/registry/pod/registry.go +++ b/pkg/registry/pod/registry.go @@ -21,7 +21,6 @@ import ( "github.com/GoogleCloudPlatform/kubernetes/pkg/api/rest" "github.com/GoogleCloudPlatform/kubernetes/pkg/fields" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" - "github.com/GoogleCloudPlatform/kubernetes/pkg/runtime" "github.com/GoogleCloudPlatform/kubernetes/pkg/watch" ) @@ -41,26 +40,14 @@ type Registry interface { DeletePod(ctx api.Context, podID string) error } -// Storage is an interface for a standard REST Storage backend -// TODO: move me somewhere common -type Storage interface { - rest.GracefulDeleter - rest.Lister - rest.Getter - rest.Watcher - - Create(ctx api.Context, obj runtime.Object) (runtime.Object, error) - Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error) -} - // storage puts strong typing around storage calls type storage struct { - Storage + rest.StandardStorage } // NewRegistry returns a new Registry interface for the given Storage. Any mismatched // types will panic. -func NewRegistry(s Storage) Registry { +func NewRegistry(s rest.StandardStorage) Registry { return &storage{s} } diff --git a/pkg/registry/resourcequota/registry.go b/pkg/registry/resourcequota/registry.go index 5fe29686edd..ff521cc1cf6 100644 --- a/pkg/registry/resourcequota/registry.go +++ b/pkg/registry/resourcequota/registry.go @@ -21,7 +21,6 @@ import ( "github.com/GoogleCloudPlatform/kubernetes/pkg/api/rest" "github.com/GoogleCloudPlatform/kubernetes/pkg/fields" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" - "github.com/GoogleCloudPlatform/kubernetes/pkg/runtime" "github.com/GoogleCloudPlatform/kubernetes/pkg/watch" ) @@ -41,26 +40,14 @@ type Registry interface { DeleteResourceQuota(ctx api.Context, podID string) error } -// Storage is an interface for a standard REST Storage backend -// TODO: move me somewhere common -type Storage interface { - rest.GracefulDeleter - rest.Lister - rest.Getter - rest.Watcher - - Create(ctx api.Context, obj runtime.Object) (runtime.Object, error) - Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error) -} - // storage puts strong typing around storage calls type storage struct { - Storage + rest.StandardStorage } // NewRegistry returns a new Registry interface for the given Storage. Any mismatched // types will panic. -func NewRegistry(s Storage) Registry { +func NewRegistry(s rest.StandardStorage) Registry { return &storage{s} }