In preparation for new storage backends renaming generic registry store

This commit is contained in:
Timothy St. Clair 2016-04-08 14:57:28 -05:00
parent 06598a19ee
commit 04ef3fdb57
1 changed files with 5 additions and 5 deletions

View File

@ -22,13 +22,13 @@ import (
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/registry/generic"
etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd"
"k8s.io/kubernetes/pkg/registry/generic/registry"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/storage"
)
type REST struct {
*etcdgeneric.Etcd
*registry.Store
}
// NewREST returns a RESTStorage object that will work with testtype.
@ -39,19 +39,19 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
strategy := &NotNamespaceScoped{}
storageInterface := storageDecorator(
s, 100, &testgroup.TestType{}, prefix, strategy, newListFunc)
store := &etcdgeneric.Etcd{
store := &registry.Store{
NewFunc: func() runtime.Object { return &testgroup.TestType{} },
// NewListFunc returns an object capable of storing results of an etcd list.
NewListFunc: newListFunc,
// Produces a path that etcd understands, to the root of the resource
// by combining the namespace in the context with the given prefix.
KeyRootFunc: func(ctx api.Context) string {
return etcdgeneric.NamespaceKeyRootFunc(ctx, prefix)
return registry.NamespaceKeyRootFunc(ctx, prefix)
},
// Produces a path that etcd understands, to the resource by combining
// the namespace in the context with the given prefix.
KeyFunc: func(ctx api.Context, name string) (string, error) {
return etcdgeneric.NamespaceKeyFunc(ctx, prefix, name)
return registry.NamespaceKeyFunc(ctx, prefix, name)
},
// Retrieve the name field of the resource.
ObjectNameFunc: func(obj runtime.Object) (string, error) {