diff --git a/pkg/registry/namespace/etcd/etcd.go b/pkg/registry/namespace/etcd/etcd.go index edc641f6f4..6bb35dd77e 100644 --- a/pkg/registry/namespace/etcd/etcd.go +++ b/pkg/registry/namespace/etcd/etcd.go @@ -25,12 +25,11 @@ import ( "github.com/GoogleCloudPlatform/kubernetes/pkg/registry/namespace" "github.com/GoogleCloudPlatform/kubernetes/pkg/runtime" "github.com/GoogleCloudPlatform/kubernetes/pkg/tools" - "github.com/GoogleCloudPlatform/kubernetes/pkg/watch" ) // rest implements a RESTStorage for namespaces against etcd type REST struct { - store *etcdgeneric.Etcd + *etcdgeneric.Etcd } // NewREST returns a RESTStorage object that will work against namespaces @@ -57,45 +56,5 @@ func NewREST(h tools.EtcdHelper) *REST { store.UpdateStrategy = namespace.Strategy store.ReturnDeletedObject = true - return &REST{store: store} -} - -// New returns a new object -func (r *REST) New() runtime.Object { - return r.store.NewFunc() -} - -// NewList returns a new list object -func (r *REST) NewList() runtime.Object { - return r.store.NewListFunc() -} - -// List obtains a list of namespaces with labels that match selector. -func (r *REST) List(ctx api.Context, label labels.Selector, field fields.Selector) (runtime.Object, error) { - return r.store.List(ctx, label, field) -} - -// Watch begins watching for new, changed, or deleted namespaces -func (r *REST) Watch(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) { - return r.store.Watch(ctx, label, field, resourceVersion) -} - -// Get gets a specific namespace specified by its name -func (r *REST) Get(ctx api.Context, name string) (runtime.Object, error) { - return r.store.Get(ctx, name) -} - -// Create creates a namespace based on a specification. -func (r *REST) Create(ctx api.Context, obj runtime.Object) (runtime.Object, error) { - return r.store.Create(ctx, obj) -} - -// Update changes a namespace specification. -func (r *REST) Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error) { - return r.store.Update(ctx, obj) -} - -// Delete deletes an existing namespace specified by its name -func (r *REST) Delete(ctx api.Context, name string) (runtime.Object, error) { - return r.store.Delete(ctx, name) + return &REST{Etcd: store} } diff --git a/pkg/registry/namespace/rest.go b/pkg/registry/namespace/rest.go index cff82b4513..908858eab2 100644 --- a/pkg/registry/namespace/rest.go +++ b/pkg/registry/namespace/rest.go @@ -38,7 +38,7 @@ type namespaceStrategy struct { // objects via the REST API. var Strategy = namespaceStrategy{api.Scheme, api.SimpleNameGenerator} -// NamespaceScoped is true for namespaces. +// NamespaceScoped is false for namespaces. func (namespaceStrategy) NamespaceScoped() bool { return false }