Rename JSONBase -> TypeMeta in preparation for v1beta3
Will make subsequent refactor much easier
This commit is contained in:
@@ -24,18 +24,18 @@ import (
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
type JSONBase struct {
|
||||
type TypeMeta struct {
|
||||
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
|
||||
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
|
||||
}
|
||||
|
||||
type InternalSimple struct {
|
||||
JSONBase `json:",inline" yaml:",inline"`
|
||||
TypeMeta `json:",inline" yaml:",inline"`
|
||||
TestString string `json:"testString" yaml:"testString"`
|
||||
}
|
||||
|
||||
type ExternalSimple struct {
|
||||
JSONBase `json:",inline" yaml:",inline"`
|
||||
TypeMeta `json:",inline" yaml:",inline"`
|
||||
TestString string `json:"testString" yaml:"testString"`
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ func TestScheme(t *testing.T) {
|
||||
if e, a := "externalVersion", scope.Meta().DestVersion; e != a {
|
||||
t.Errorf("Expected '%v', got '%v'", e, a)
|
||||
}
|
||||
scope.Convert(&in.JSONBase, &out.JSONBase, 0)
|
||||
scope.Convert(&in.TypeMeta, &out.TypeMeta, 0)
|
||||
scope.Convert(&in.TestString, &out.TestString, 0)
|
||||
internalToExternalCalls++
|
||||
return nil
|
||||
@@ -71,7 +71,7 @@ func TestScheme(t *testing.T) {
|
||||
if e, a := "", scope.Meta().DestVersion; e != a {
|
||||
t.Errorf("Expected '%v', got '%v'", e, a)
|
||||
}
|
||||
scope.Convert(&in.JSONBase, &out.JSONBase, 0)
|
||||
scope.Convert(&in.TypeMeta, &out.TypeMeta, 0)
|
||||
scope.Convert(&in.TestString, &out.TestString, 0)
|
||||
externalToInternalCalls++
|
||||
return nil
|
||||
@@ -150,12 +150,12 @@ type ExtensionB struct {
|
||||
}
|
||||
|
||||
type ExternalExtensionType struct {
|
||||
JSONBase `json:",inline" yaml:",inline"`
|
||||
TypeMeta `json:",inline" yaml:",inline"`
|
||||
Extension runtime.RawExtension `json:"extension" yaml:"extension"`
|
||||
}
|
||||
|
||||
type InternalExtensionType struct {
|
||||
JSONBase `json:",inline" yaml:",inline"`
|
||||
TypeMeta `json:",inline" yaml:",inline"`
|
||||
Extension runtime.EmbeddedObject `json:"extension" yaml:"extension"`
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user