internal versions

This commit is contained in:
deads2k
2015-11-17 13:21:32 -05:00
parent 6231404682
commit 68b0572974
17 changed files with 222 additions and 108 deletions

View File

@@ -23,6 +23,7 @@ import (
"strings"
"testing"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/util"
"github.com/ghodss/yaml"
@@ -118,7 +119,6 @@ func GetTestScheme() *Scheme {
s.AddKnownTypeWithName("v1", "TestType2", &ExternalTestType2{})
s.AddKnownTypeWithName("", "TestType3", &TestType1{})
s.AddKnownTypeWithName("v1", "TestType3", &ExternalTestType1{})
s.InternalVersion = ""
s.MetaFactory = testMetaFactory{}
return s
}
@@ -361,7 +361,7 @@ func TestBadJSONRejection(t *testing.T) {
func TestBadJSONRejectionForSetInternalVersion(t *testing.T) {
s := GetTestScheme()
s.InternalVersion = "v1"
s.InternalVersions[""] = unversioned.GroupVersion{Version: "v1"}
badJSONs := [][]byte{
[]byte(`{"myKindKey":"TestType1"}`), // Missing version
}