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

@@ -144,3 +144,14 @@ func TestCodec(t *testing.T) {
t.Errorf("unexpected unmarshalled object %#v", other)
}
}
func TestInterfacesFor(t *testing.T) {
if _, _, err := InterfacesFor(""); err == nil {
t.Fatalf("unexpected non-error: %v", err)
}
for i, version := range append([]string{Version, OldestVersion}, Versions...) {
if codec, versioner, err := InterfacesFor(version); err != nil || codec == nil || versioner == nil {
t.Fatalf("%d: unexpected result: %v", i, err)
}
}
}