Merge pull request #9280 from caesarxuchao/make-v1-preferred

Make v1 the preferred api version
This commit is contained in:
Quinton Hoole
2015-06-05 15:23:14 -07:00
6 changed files with 42 additions and 36 deletions

View File

@@ -70,11 +70,11 @@ func TestInterfacesFor(t *testing.T) {
}
func TestRESTMapper(t *testing.T) {
if v, k, err := RESTMapper.VersionAndKindForResource("replicationcontrollers"); err != nil || v != "v1beta3" || k != "ReplicationController" {
if v, k, err := RESTMapper.VersionAndKindForResource("replicationcontrollers"); err != nil || v != "v1" || k != "ReplicationController" {
t.Errorf("unexpected version mapping: %s %s %v", v, k, err)
}
if m, err := RESTMapper.RESTMapping("PodTemplate", ""); err != nil || m.APIVersion != "v1beta3" || m.Resource != "podtemplates" {
if m, err := RESTMapper.RESTMapping("PodTemplate", ""); err != nil || m.APIVersion != "v1" || m.Resource != "podtemplates" {
t.Errorf("unexpected version mapping: %#v %v", m, err)
}

View File

@@ -35,7 +35,7 @@ func init() {
}
// The default list of supported api versions, in order of most preferred to the least.
defaultSupportedVersions := "v1beta3,v1"
defaultSupportedVersions := "v1,v1beta3"
// Env var KUBE_API_VERSIONS is a comma separated list of API versions that should be registered in the scheme.
// The versions should be in the order of most preferred to the least.
supportedVersions := os.Getenv("KUBE_API_VERSIONS")