Move StorageInterface to pkg/storage.

This commit is contained in:
Wojciech Tyczynski
2015-07-30 09:27:38 +02:00
parent 769230e735
commit d17985f1ad
43 changed files with 284 additions and 223 deletions

View File

@@ -35,7 +35,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/master"
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools"
"github.com/GoogleCloudPlatform/kubernetes/pkg/storage"
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools/etcdtest"
"github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/admission/admit"
"github.com/golang/glog"
@@ -72,7 +72,7 @@ type MasterComponents struct {
// Used to stop master components individually, and via MasterComponents.Stop
once sync.Once
// Kubernetes etcd storage, has embedded etcd client
EtcdStorage tools.StorageInterface
EtcdStorage storage.StorageInterface
}
// Config is a struct of configuration directives for NewMasterComponents.
@@ -119,13 +119,13 @@ func NewMasterComponents(c *Config) *MasterComponents {
}
// startMasterOrDie starts a kubernetes master and an httpserver to handle api requests
func startMasterOrDie(masterConfig *master.Config) (*master.Master, *httptest.Server, tools.StorageInterface) {
func startMasterOrDie(masterConfig *master.Config) (*master.Master, *httptest.Server, storage.StorageInterface) {
var m *master.Master
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
m.Handler.ServeHTTP(w, req)
}))
var etcdStorage tools.StorageInterface
var etcdStorage storage.StorageInterface
var err error
if masterConfig == nil {
etcdStorage, err = master.NewEtcdStorage(NewEtcdClient(), "", etcdtest.PathPrefix())