Stop exposing v1beta3 by default

This commit is contained in:
nikhiljindal
2015-06-29 19:30:14 -07:00
parent 9363285b4a
commit 274792d7bb
37 changed files with 117 additions and 242 deletions

View File

@@ -34,7 +34,7 @@ var Version string
// OldestVersion is the string that represents the oldest server version supported,
// for client code that wants to hardcode the lowest common denominator.
const OldestVersion = "v1beta3"
var OldestVersion string
// Versions is the list of versions that are recognized in code. The order provided
// may be assumed to be least feature rich to most feature rich, and clients may
@@ -67,6 +67,7 @@ var userResources = []string{"rc", "svc", "pods", "pvc"}
func init() {
// Use the first API version in the list of registered versions as the latest.
Version = registered.RegisteredVersions[0]
OldestVersion = registered.RegisteredVersions[len(registered.RegisteredVersions)-1]
Codec = runtime.CodecFor(api.Scheme, Version)
// Put the registered versions in Versions in reverse order.
versions := registered.RegisteredVersions

View File

@@ -26,9 +26,8 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/meta"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/testapi"
apitesting "github.com/GoogleCloudPlatform/kubernetes/pkg/api/testing"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta3"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/davecgh/go-spew/spew"
@@ -88,13 +87,10 @@ func roundTripSame(t *testing.T, item runtime.Object, except ...string) {
set := util.NewStringSet(except...)
seed := rand.Int63()
fuzzInternalObject(t, "", item, seed)
if !set.Has("v1beta3") {
fuzzInternalObject(t, "v1beta3", item, seed)
roundTrip(t, v1beta3.Codec, item)
}
if !set.Has("v1") {
fuzzInternalObject(t, "v1", item, seed)
roundTrip(t, v1.Codec, item)
version := testapi.Version()
if !set.Has(version) {
fuzzInternalObject(t, version, item, seed)
roundTrip(t, testapi.Codec(), item)
}
}

View File

@@ -84,7 +84,7 @@ func TestBadSecurityContextConversion(t *testing.T) {
c *versioned.Container
err string
}{
// this use case must use true for the container and false for the sc. Otherwise the defaulter
// this use case must use true for the container and false for the sc. Otherwise the defaulter
// will assume privileged was left undefined (since it is the default value) and copy the
// sc setting upwards
"mismatched privileged": {

View File

@@ -24,6 +24,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/resource"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/testapi"
"github.com/GoogleCloudPlatform/kubernetes/pkg/capabilities"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
utilerrors "github.com/GoogleCloudPlatform/kubernetes/pkg/util/errors"
@@ -556,7 +557,7 @@ func TestValidateEnv(t *testing.T) {
Name: "abc",
ValueFrom: &api.EnvVarSource{
FieldRef: &api.ObjectFieldSelector{
APIVersion: "v1beta3",
APIVersion: testapi.Version(),
FieldPath: "metadata.name",
},
},
@@ -588,7 +589,7 @@ func TestValidateEnv(t *testing.T) {
Value: "foo",
ValueFrom: &api.EnvVarSource{
FieldRef: &api.ObjectFieldSelector{
APIVersion: "v1beta3",
APIVersion: testapi.Version(),
FieldPath: "metadata.name",
},
},
@@ -601,7 +602,7 @@ func TestValidateEnv(t *testing.T) {
Name: "abc",
ValueFrom: &api.EnvVarSource{
FieldRef: &api.ObjectFieldSelector{
APIVersion: "v1beta3",
APIVersion: testapi.Version(),
},
},
}},
@@ -626,7 +627,7 @@ func TestValidateEnv(t *testing.T) {
ValueFrom: &api.EnvVarSource{
FieldRef: &api.ObjectFieldSelector{
FieldPath: "metadata.whoops",
APIVersion: "v1beta3",
APIVersion: testapi.Version(),
},
},
}},
@@ -639,7 +640,7 @@ func TestValidateEnv(t *testing.T) {
ValueFrom: &api.EnvVarSource{
FieldRef: &api.ObjectFieldSelector{
FieldPath: "status.phase",
APIVersion: "v1beta3",
APIVersion: testapi.Version(),
},
},
}},