Register the API versions to the DefaultRESTMapper in the order of preferred versions first.

This makes kubectl sends requests to URLs in the format defined by the latest API version.
This commit is contained in:
Chao Xu
2015-04-29 11:17:55 -07:00
parent f74fab4e56
commit 4787c66214
7 changed files with 15 additions and 13 deletions

View File

@@ -53,7 +53,7 @@ func TestDeleteObjectByTuple(t *testing.T) {
cmd.Flags().Set("cascade", "false")
cmd.Run(cmd, []string{"replicationcontrollers/redis-master-controller"})
if buf.String() != "replicationControllers/redis-master-controller\n" {
if buf.String() != "replicationcontrollers/redis-master-controller\n" {
t.Errorf("unexpected output: %s", buf.String())
}
}
@@ -84,7 +84,7 @@ func TestDeleteNamedObject(t *testing.T) {
cmd.Flags().Set("cascade", "false")
cmd.Run(cmd, []string{"replicationcontrollers", "redis-master-controller"})
if buf.String() != "replicationControllers/redis-master-controller\n" {
if buf.String() != "replicationcontrollers/redis-master-controller\n" {
t.Errorf("unexpected output: %s", buf.String())
}
}

View File

@@ -163,7 +163,7 @@ func TestGetUnknownSchemaObjectListGeneric(t *testing.T) {
output: "unlikelyversion",
list: "v1beta3",
obj1: "unlikelyversion", // doesn't have v1beta3
obj2: "v1beta1", // version of the API response
obj2: "v1beta3", // version of the API response
},
"handles common version": {
output: "v1beta1",