Merge pull request #37547 from sttts/sttts-cut-off-genericapserver-from-registry
Automatic merge from submit-queue Cut genericapserver->registry dependency Towards moving genericapiserver into staging.
This commit is contained in:
commit
adf111beb8
|
@ -24,14 +24,14 @@ import (
|
|||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/generic"
|
||||
"k8s.io/kubernetes/pkg/registry/generic/registry"
|
||||
genericregistry "k8s.io/kubernetes/pkg/registry/generic/registry"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/storage"
|
||||
"k8s.io/kubernetes/pkg/storage/storagebackend"
|
||||
)
|
||||
|
||||
type REST struct {
|
||||
*registry.Store
|
||||
*genericregistry.Store
|
||||
}
|
||||
|
||||
// NewREST returns a RESTStorage object that will work with testtype.
|
||||
|
@ -49,19 +49,19 @@ func NewREST(config *storagebackend.Config, storageDecorator generic.StorageDeco
|
|||
}
|
||||
storageInterface, _ := storageDecorator(
|
||||
config, 100, &testgroup.TestType{}, prefix, strategy, newListFunc, getAttrs, storage.NoTriggerPublisher)
|
||||
store := ®istry.Store{
|
||||
store := &genericregistry.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 registry.NamespaceKeyRootFunc(ctx, prefix)
|
||||
return genericregistry.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 registry.NamespaceKeyFunc(ctx, prefix, name)
|
||||
return genericregistry.NamespaceKeyFunc(ctx, prefix, name)
|
||||
},
|
||||
// Retrieve the name field of the resource.
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
|
Loading…
Reference in New Issue