Private EtcdHelper
This commit is contained in:
@@ -29,8 +29,8 @@ type registry struct {
|
||||
*etcdgeneric.Etcd
|
||||
}
|
||||
|
||||
// NewEtcdRegistry returns a registry which will store LimitRange in the given helper
|
||||
func NewEtcdRegistry(h tools.EtcdHelper) generic.Registry {
|
||||
// NewEtcdRegistry returns a registry which will store LimitRange in the given storage
|
||||
func NewEtcdRegistry(s tools.StorageInterface) generic.Registry {
|
||||
prefix := "/limitranges"
|
||||
return registry{
|
||||
Etcd: &etcdgeneric.Etcd{
|
||||
@@ -43,7 +43,7 @@ func NewEtcdRegistry(h tools.EtcdHelper) generic.Registry {
|
||||
KeyFunc: func(ctx api.Context, id string) (string, error) {
|
||||
return etcdgeneric.NamespaceKeyFunc(ctx, prefix, id)
|
||||
},
|
||||
Helper: h,
|
||||
Storage: s,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@@ -37,8 +37,8 @@ import (
|
||||
func NewTestLimitRangeEtcdRegistry(t *testing.T) (*tools.FakeEtcdClient, generic.Registry) {
|
||||
f := tools.NewFakeEtcdClient(t)
|
||||
f.TestIndex = true
|
||||
h := tools.NewEtcdHelper(f, testapi.Codec(), etcdtest.PathPrefix())
|
||||
return f, NewEtcdRegistry(h)
|
||||
s := tools.NewEtcdStorage(f, testapi.Codec(), etcdtest.PathPrefix())
|
||||
return f, NewEtcdRegistry(s)
|
||||
}
|
||||
|
||||
func TestLimitRangeCreate(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user