diff --git a/pkg/api/serialization_test.go b/pkg/api/serialization_test.go index ddd32ac0097..932852ace02 100644 --- a/pkg/api/serialization_test.go +++ b/pkg/api/serialization_test.go @@ -48,15 +48,6 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( // APIVersion and Kind must remain blank in memory. j.APIVersion = "" j.Kind = "" - - j.Name = c.RandString() - j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) - j.SelfLink = c.RandString() - - var sec, nsec int64 - c.Fuzz(&sec) - c.Fuzz(&nsec) - j.CreationTimestamp = util.Unix(sec, nsec).Rfc3339Copy() }, func(j *api.TypeMeta, c fuzz.Continue) { // We have to customize the randomization of TypeMetas because their diff --git a/pkg/api/validation/schema_test.go b/pkg/api/validation/schema_test.go index 34a0cf3559c..7ed8670e19f 100644 --- a/pkg/api/validation/schema_test.go +++ b/pkg/api/validation/schema_test.go @@ -49,15 +49,6 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( // APIVersion and Kind must remain blank in memory. j.APIVersion = "" j.Kind = "" - - j.Name = c.RandString() - j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) - j.SelfLink = c.RandString() - - var sec, nsec int64 - c.Fuzz(&sec) - c.Fuzz(&nsec) - j.CreationTimestamp = util.Unix(sec, nsec).Rfc3339Copy() }, func(j *api.TypeMeta, c fuzz.Continue) { // We have to customize the randomization of TypeMetas because their diff --git a/pkg/runtime/embedded_test.go b/pkg/runtime/embedded_test.go index 9fb795c95bb..c9ad19725f5 100644 --- a/pkg/runtime/embedded_test.go +++ b/pkg/runtime/embedded_test.go @@ -50,11 +50,11 @@ func TestEmbeddedObject(t *testing.T) { s.AddKnownTypeWithName("v1test", "EmbeddedTest", &EmbeddedTestExternal{}) outer := &EmbeddedTest{ - TypeMeta: runtime.TypeMeta{Name: "outer"}, + TypeMeta: runtime.TypeMeta{}, ID: "outer", Object: runtime.EmbeddedObject{ &EmbeddedTest{ - TypeMeta: runtime.TypeMeta{Name: "inner"}, + TypeMeta: runtime.TypeMeta{}, ID: "inner", }, }, @@ -83,7 +83,7 @@ func TestEmbeddedObject(t *testing.T) { if err != nil { t.Fatalf("Unexpected decode error %v", err) } - if externalViaJSON.Kind == "" || externalViaJSON.APIVersion == "" || externalViaJSON.Name != "outer" { + if externalViaJSON.Kind == "" || externalViaJSON.APIVersion == "" || externalViaJSON.ID != "outer" { t.Errorf("Expected objects to have type info set, got %#v", externalViaJSON) } if !reflect.DeepEqual(externalViaJSON.EmptyObject.RawJSON, []byte("null")) || len(externalViaJSON.Object.RawJSON) == 0 { diff --git a/pkg/runtime/types.go b/pkg/runtime/types.go index aa7eec39201..da7e0e93c5d 100644 --- a/pkg/runtime/types.go +++ b/pkg/runtime/types.go @@ -16,9 +16,7 @@ limitations under the License. package runtime -import ( - "github.com/GoogleCloudPlatform/kubernetes/pkg/util" -) +import () // Note that the types provided in this file are not versioned and are intended to be // safe to use from within all versions of every API object. @@ -35,15 +33,8 @@ import ( // your own with the same fields. // type TypeMeta struct { - APIVersion string `json:"apiVersion,omitempty"` - Kind string `json:"kind,omitempty"` - - Namespace string `json:"namespace,omitempty"` - Name string `json:"name,omitempty"` - UID string `json:"uid,omitempty"` - CreationTimestamp util.Time `json:"creationTimestamp,omitempty"` - SelfLink string `json:"selfLink,omitempty"` - ResourceVersion string `json:"resourceVersion,omitempty"` + APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` } // PluginBase is like TypeMeta, but it's intended for plugin objects that won't ever be encoded