Allow server and client to take api version as argument

* Defaults to v1beta1
* apiserver takes -storage_version which controls etcd storage version
  and the version of the client used to connect to other apiservers
* Changed signature of client.New to add version parameter
* All controller code and component code prefers the oldest (most common)
  server version
This commit is contained in:
Clayton Coleman
2014-09-11 19:01:29 -04:00
parent ca5355908f
commit 5483333e29
22 changed files with 309 additions and 164 deletions

View File

@@ -106,19 +106,27 @@ func startComponents(manifestURL string) (apiServerURL string) {
}
}
cl := client.NewOrDie(apiServer.URL, nil)
cl := client.NewOrDie(apiServer.URL, "", nil)
cl.PollPeriod = time.Second * 1
cl.Sync = true
helper, err := master.NewEtcdHelper(servers, "")
if err != nil {
glog.Fatalf("Unable to get etcd helper: %v", err)
}
// Master
m := master.New(&master.Config{
Client: cl,
EtcdServers: servers,
EtcdHelper: helper,
Minions: machineList,
PodInfoGetter: fakePodInfoGetter{},
})
storage, codec := m.API_v1beta1()
handler.delegate = apiserver.Handle(storage, codec, "/api/v1beta1")
mux := http.NewServeMux()
apiserver.NewAPIGroup(m.API_v1beta1()).InstallREST(mux, "/api/v1beta1")
apiserver.NewAPIGroup(m.API_v1beta2()).InstallREST(mux, "/api/v1beta2")
apiserver.InstallSupport(mux)
handler.delegate = mux
// Scheduler
scheduler.New((&factory.ConfigFactory{cl}).Create()).Run()
@@ -303,7 +311,7 @@ func main() {
// Wait for the synchronization threads to come up.
time.Sleep(time.Second * 10)
kubeClient := client.NewOrDie(apiServerURL, nil)
kubeClient := client.NewOrDie(apiServerURL, "", nil)
// Run tests in parallel
testFuncs := []testFunc{