Fix references from serializable types to use v1.ObjectMeta

This commit is contained in:
Jordan Liggitt
2016-12-08 16:26:04 -05:00
parent 711986876b
commit fcf5bbccd6
12 changed files with 67 additions and 64 deletions

View File

@@ -25,7 +25,7 @@ import (
"errors"
"fmt"
codec1978 "github.com/ugorji/go/codec"
pkg2_api "k8s.io/kubernetes/pkg/api"
pkg2_v1 "k8s.io/kubernetes/pkg/api/v1"
pkg1_v1 "k8s.io/kubernetes/pkg/apis/meta/v1"
pkg3_types "k8s.io/kubernetes/pkg/types"
"reflect"
@@ -63,7 +63,7 @@ func init() {
panic(err)
}
if false { // reference the types, but skip this branch at build/run time
var v0 pkg2_api.ObjectMeta
var v0 pkg2_v1.ObjectMeta
var v1 pkg1_v1.TypeMeta
var v2 pkg3_types.UID
var v3 time.Time
@@ -264,7 +264,7 @@ func (x *TestType) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
}
case "metadata":
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_api.ObjectMeta{}
x.ObjectMeta = pkg2_v1.ObjectMeta{}
} else {
yyv20 := &x.ObjectMeta
yyv20.CodecDecodeSelf(d)
@@ -334,7 +334,7 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_api.ObjectMeta{}
x.ObjectMeta = pkg2_v1.ObjectMeta{}
} else {
yyv25 := &x.ObjectMeta
yyv25.CodecDecodeSelf(d)

View File

@@ -17,7 +17,7 @@ limitations under the License.
package v1
import (
"k8s.io/kubernetes/pkg/api"
apiv1 "k8s.io/kubernetes/pkg/api/v1"
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
)
@@ -30,7 +30,7 @@ type TestType struct {
// unversioned objects in the generate file that is not used anywhere other than this test type.
// +k8s:openapi-gen=false
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
apiv1.ObjectMeta `json:"metadata,omitempty"`
// +optional
Status TestTypeStatus `json:"status,omitempty"`
}