mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-08 14:29:45 +00:00
Fix references from serializable types to use v1.ObjectMeta
This commit is contained in:
@@ -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
|
||||
@@ -346,7 +346,7 @@ func (x *TestStruct) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
|
||||
}
|
||||
case "metadata":
|
||||
if r.TryDecodeAsNil() {
|
||||
x.ObjectMeta = pkg2_api.ObjectMeta{}
|
||||
x.ObjectMeta = pkg2_v1.ObjectMeta{}
|
||||
} else {
|
||||
yyv29 := &x.ObjectMeta
|
||||
yyv29.CodecDecodeSelf(d)
|
||||
@@ -451,7 +451,7 @@ func (x *TestStruct) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
||||
}
|
||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
||||
if r.TryDecodeAsNil() {
|
||||
x.ObjectMeta = pkg2_api.ObjectMeta{}
|
||||
x.ObjectMeta = pkg2_v1.ObjectMeta{}
|
||||
} else {
|
||||
yyv40 := &x.ObjectMeta
|
||||
yyv40.CodecDecodeSelf(d)
|
||||
|
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package testing
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
apiv1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||
)
|
||||
@@ -25,11 +25,11 @@ import (
|
||||
type TestStruct struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// +optional
|
||||
api.ObjectMeta `json:"metadata,omitempty"`
|
||||
Key string `json:"Key"`
|
||||
Map map[string]int `json:"Map"`
|
||||
StringList []string `json:"StringList"`
|
||||
IntList []int `json:"IntList"`
|
||||
apiv1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Key string `json:"Key"`
|
||||
Map map[string]int `json:"Map"`
|
||||
StringList []string `json:"StringList"`
|
||||
IntList []int `json:"IntList"`
|
||||
}
|
||||
|
||||
func (obj *TestStruct) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
|
Reference in New Issue
Block a user