Private EtcdHelper
This commit is contained in:
@@ -37,7 +37,7 @@ type REST struct {
|
||||
var controllerPrefix = "/controllers"
|
||||
|
||||
// NewREST returns a RESTStorage object that will work against replication controllers.
|
||||
func NewREST(h tools.EtcdHelper) *REST {
|
||||
func NewREST(s tools.StorageInterface) *REST {
|
||||
store := &etcdgeneric.Etcd{
|
||||
NewFunc: func() runtime.Object { return &api.ReplicationController{} },
|
||||
|
||||
@@ -69,7 +69,7 @@ func NewREST(h tools.EtcdHelper) *REST {
|
||||
// Used to validate controller updates
|
||||
UpdateStrategy: controller.Strategy,
|
||||
|
||||
Helper: h,
|
||||
Storage: s,
|
||||
}
|
||||
|
||||
return &REST{store}
|
||||
|
@@ -40,17 +40,17 @@ const (
|
||||
FAIL
|
||||
)
|
||||
|
||||
func newHelper(t *testing.T) (*tools.FakeEtcdClient, tools.EtcdHelper) {
|
||||
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, tools.StorageInterface) {
|
||||
fakeEtcdClient := tools.NewFakeEtcdClient(t)
|
||||
fakeEtcdClient.TestIndex = true
|
||||
helper := tools.NewEtcdHelper(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())
|
||||
return fakeEtcdClient, helper
|
||||
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())
|
||||
return fakeEtcdClient, etcdStorage
|
||||
}
|
||||
|
||||
// newStorage creates a REST storage backed by etcd helpers
|
||||
func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) {
|
||||
fakeEtcdClient, h := newHelper(t)
|
||||
storage := NewREST(h)
|
||||
fakeEtcdClient, s := newEtcdStorage(t)
|
||||
storage := NewREST(s)
|
||||
return storage, fakeEtcdClient
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user