In preparation for new storage backends renaming generic registry store
This commit is contained in:
parent
06598a19ee
commit
04ef3fdb57
|
@ -22,13 +22,13 @@ import (
|
||||||
"k8s.io/kubernetes/pkg/fields"
|
"k8s.io/kubernetes/pkg/fields"
|
||||||
"k8s.io/kubernetes/pkg/labels"
|
"k8s.io/kubernetes/pkg/labels"
|
||||||
"k8s.io/kubernetes/pkg/registry/generic"
|
"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/runtime"
|
||||||
"k8s.io/kubernetes/pkg/storage"
|
"k8s.io/kubernetes/pkg/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
type REST struct {
|
type REST struct {
|
||||||
*etcdgeneric.Etcd
|
*registry.Store
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewREST returns a RESTStorage object that will work with testtype.
|
// 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{}
|
strategy := &NotNamespaceScoped{}
|
||||||
storageInterface := storageDecorator(
|
storageInterface := storageDecorator(
|
||||||
s, 100, &testgroup.TestType{}, prefix, strategy, newListFunc)
|
s, 100, &testgroup.TestType{}, prefix, strategy, newListFunc)
|
||||||
store := &etcdgeneric.Etcd{
|
store := ®istry.Store{
|
||||||
NewFunc: func() runtime.Object { return &testgroup.TestType{} },
|
NewFunc: func() runtime.Object { return &testgroup.TestType{} },
|
||||||
// NewListFunc returns an object capable of storing results of an etcd list.
|
// NewListFunc returns an object capable of storing results of an etcd list.
|
||||||
NewListFunc: newListFunc,
|
NewListFunc: newListFunc,
|
||||||
// Produces a path that etcd understands, to the root of the resource
|
// Produces a path that etcd understands, to the root of the resource
|
||||||
// by combining the namespace in the context with the given prefix.
|
// by combining the namespace in the context with the given prefix.
|
||||||
KeyRootFunc: func(ctx api.Context) string {
|
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
|
// Produces a path that etcd understands, to the resource by combining
|
||||||
// the namespace in the context with the given prefix.
|
// the namespace in the context with the given prefix.
|
||||||
KeyFunc: func(ctx api.Context, name string) (string, error) {
|
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.
|
// Retrieve the name field of the resource.
|
||||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||||
|
|
Loading…
Reference in New Issue