RESTMapper should take into account multiple versions

When a CLI command `kubectl get rc --api-version=v1beta3` is called,
the API resource name should match v1beta3, not whatever the default
RESTMapper version is.  This allows the correct resource name to be
returned ("replicationcontrollers", instead of "replicationControllers").
This commit is contained in:
Clayton Coleman
2014-12-12 14:05:27 -05:00
parent 9b6aec5e22
commit 8bef68d475
9 changed files with 76 additions and 38 deletions

View File

@@ -228,7 +228,7 @@ func TestRESTMapper(t *testing.T) {
}
for _, version := range Versions {
mapping, err := RESTMapper.RESTMapping(version, "ReplicationController")
mapping, err := RESTMapper.RESTMapping("ReplicationController", version)
if err != nil {
t.Errorf("unexpected error: %v", err)
}