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

@@ -117,7 +117,7 @@ func TestSyncReplicationControllerDoesNothing(t *testing.T) {
ResponseBody: string(body),
}
testServer := httptest.NewTLSServer(&fakeHandler)
client := client.NewOrDie(testServer.URL, nil)
client := client.NewOrDie(testServer.URL, "v1beta1", nil)
fakePodControl := FakePodControl{}
@@ -137,7 +137,7 @@ func TestSyncReplicationControllerDeletes(t *testing.T) {
ResponseBody: string(body),
}
testServer := httptest.NewTLSServer(&fakeHandler)
client := client.NewOrDie(testServer.URL, nil)
client := client.NewOrDie(testServer.URL, "v1beta1", nil)
fakePodControl := FakePodControl{}
@@ -157,7 +157,7 @@ func TestSyncReplicationControllerCreates(t *testing.T) {
ResponseBody: string(body),
}
testServer := httptest.NewTLSServer(&fakeHandler)
client := client.NewOrDie(testServer.URL, nil)
client := client.NewOrDie(testServer.URL, "v1beta1", nil)
fakePodControl := FakePodControl{}
@@ -177,7 +177,7 @@ func TestCreateReplica(t *testing.T) {
ResponseBody: string(body),
}
testServer := httptest.NewTLSServer(&fakeHandler)
client := client.NewOrDie(testServer.URL, nil)
client := client.NewOrDie(testServer.URL, "v1beta1", nil)
podControl := RealPodControl{
kubeClient: client,
@@ -227,7 +227,7 @@ func TestCreateReplica(t *testing.T) {
}
}
func TestSyncronize(t *testing.T) {
func TestSynchonize(t *testing.T) {
controllerSpec1 := api.ReplicationController{
JSONBase: api.JSONBase{APIVersion: "v1beta1"},
DesiredState: api.ReplicationControllerState{
@@ -310,7 +310,7 @@ func TestSyncronize(t *testing.T) {
t.Errorf("Unexpected request for %v", req.RequestURI)
})
testServer := httptest.NewServer(mux)
client := client.NewOrDie(testServer.URL, nil)
client := client.NewOrDie(testServer.URL, "v1beta1", nil)
manager := NewReplicationManager(client)
fakePodControl := FakePodControl{}
manager.podControl = &fakePodControl