Merge pull request #7629 from caesarxuchao/new-fix-7260-7491
Change the order the different versions of API are registered
This commit is contained in:
@@ -110,7 +110,8 @@ func init() {
|
||||
},
|
||||
)
|
||||
// list of versions we support on the server
|
||||
versions := []string{"v1beta1", "v1beta2", "v1beta3", "v1"}
|
||||
// versions should be listed in the order of perferred versions first
|
||||
versions := []string{"v1beta3", "v1beta2", "v1beta1", "v1"}
|
||||
|
||||
// versions that used mixed case URL formats
|
||||
versionMixedCase := map[string]bool{
|
||||
|
@@ -72,11 +72,10 @@ func TestInterfacesFor(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRESTMapper(t *testing.T) {
|
||||
// TODO: This test does not seem right. The version returned here depends on the order in which API versions were registered. This will just return the API version that was registered first. Fix this.
|
||||
if v, k, err := RESTMapper.VersionAndKindForResource("replicationControllers"); err != nil || v != "v1beta1" || k != "ReplicationController" {
|
||||
if v, k, err := RESTMapper.VersionAndKindForResource("replicationControllers"); err != nil || v != "v1beta3" || k != "ReplicationController" {
|
||||
t.Errorf("unexpected version mapping: %s %s %v", v, k, err)
|
||||
}
|
||||
if v, k, err := RESTMapper.VersionAndKindForResource("replicationcontrollers"); err != nil || v != "v1beta1" || k != "ReplicationController" {
|
||||
if v, k, err := RESTMapper.VersionAndKindForResource("replicationcontrollers"); err != nil || v != "v1beta3" || k != "ReplicationController" {
|
||||
t.Errorf("unexpected version mapping: %s %s %v", v, k, err)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user