mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Change ObjectKind signature to avoid allocations
We don't need to pass a pointer into SetGroupKindVersion() - a struct works just as well.
This commit is contained in:
parent
bffbc112f0
commit
a84e62d9e6
@ -123,33 +123,21 @@ type objectAccessor struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (obj objectAccessor) GetKind() string {
|
func (obj objectAccessor) GetKind() string {
|
||||||
if gvk := obj.GetObjectKind().GroupVersionKind(); gvk != nil {
|
return obj.GetObjectKind().GroupVersionKind().Kind
|
||||||
return gvk.Kind
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (obj objectAccessor) SetKind(kind string) {
|
func (obj objectAccessor) SetKind(kind string) {
|
||||||
gvk := obj.GetObjectKind().GroupVersionKind()
|
gvk := obj.GetObjectKind().GroupVersionKind()
|
||||||
if gvk == nil {
|
|
||||||
gvk = &unversioned.GroupVersionKind{}
|
|
||||||
}
|
|
||||||
gvk.Kind = kind
|
gvk.Kind = kind
|
||||||
obj.GetObjectKind().SetGroupVersionKind(gvk)
|
obj.GetObjectKind().SetGroupVersionKind(gvk)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (obj objectAccessor) GetAPIVersion() string {
|
func (obj objectAccessor) GetAPIVersion() string {
|
||||||
if gvk := obj.GetObjectKind().GroupVersionKind(); gvk != nil {
|
return obj.GetObjectKind().GroupVersionKind().GroupVersion().String()
|
||||||
return gvk.GroupVersion().String()
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (obj objectAccessor) SetAPIVersion(version string) {
|
func (obj objectAccessor) SetAPIVersion(version string) {
|
||||||
gvk := obj.GetObjectKind().GroupVersionKind()
|
gvk := obj.GetObjectKind().GroupVersionKind()
|
||||||
if gvk == nil {
|
|
||||||
gvk = &unversioned.GroupVersionKind{}
|
|
||||||
}
|
|
||||||
gv, err := unversioned.ParseGroupVersion(version)
|
gv, err := unversioned.ParseGroupVersion(version)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
gv = unversioned.GroupVersion{Version: version}
|
gv = unversioned.GroupVersion{Version: version}
|
||||||
|
@ -253,10 +253,10 @@ type InternalObject struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (obj *InternalObject) GetObjectKind() unversioned.ObjectKind { return obj }
|
func (obj *InternalObject) GetObjectKind() unversioned.ObjectKind { return obj }
|
||||||
func (obj *InternalObject) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (obj *InternalObject) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
obj.TypeMeta.APIVersion, obj.TypeMeta.Kind = gvk.ToAPIVersionAndKind()
|
obj.TypeMeta.APIVersion, obj.TypeMeta.Kind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
func (obj *InternalObject) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (obj *InternalObject) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
return unversioned.FromAPIVersionAndKind(obj.TypeMeta.APIVersion, obj.TypeMeta.Kind)
|
return unversioned.FromAPIVersionAndKind(obj.TypeMeta.APIVersion, obj.TypeMeta.Kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -610,10 +610,10 @@ type MyAPIObject struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (obj *MyAPIObject) GetObjectKind() unversioned.ObjectKind { return obj }
|
func (obj *MyAPIObject) GetObjectKind() unversioned.ObjectKind { return obj }
|
||||||
func (obj *MyAPIObject) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (obj *MyAPIObject) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
obj.TypeMeta.APIVersion, obj.TypeMeta.Kind = gvk.ToAPIVersionAndKind()
|
obj.TypeMeta.APIVersion, obj.TypeMeta.Kind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
func (obj *MyAPIObject) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (obj *MyAPIObject) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
return unversioned.FromAPIVersionAndKind(obj.TypeMeta.APIVersion, obj.TypeMeta.Kind)
|
return unversioned.FromAPIVersionAndKind(obj.TypeMeta.APIVersion, obj.TypeMeta.Kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,10 +54,7 @@ func GetReference(obj runtime.Object) (*ObjectReference, error) {
|
|||||||
|
|
||||||
// if the object referenced is actually persisted, we can just get kind from meta
|
// if the object referenced is actually persisted, we can just get kind from meta
|
||||||
// if we are building an object reference to something not yet persisted, we should fallback to scheme
|
// if we are building an object reference to something not yet persisted, we should fallback to scheme
|
||||||
var kind string
|
kind := gvk.Kind
|
||||||
if gvk != nil {
|
|
||||||
kind = gvk.Kind
|
|
||||||
}
|
|
||||||
if len(kind) == 0 {
|
if len(kind) == 0 {
|
||||||
// TODO: this is wrong
|
// TODO: this is wrong
|
||||||
gvk, err := Scheme.ObjectKind(obj)
|
gvk, err := Scheme.ObjectKind(obj)
|
||||||
@ -68,10 +65,7 @@ func GetReference(obj runtime.Object) (*ObjectReference, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if the object referenced is actually persisted, we can also get version from meta
|
// if the object referenced is actually persisted, we can also get version from meta
|
||||||
var version string
|
version := gvk.GroupVersion().String()
|
||||||
if gvk != nil {
|
|
||||||
version = gvk.GroupVersion().String()
|
|
||||||
}
|
|
||||||
if len(version) == 0 {
|
if len(version) == 0 {
|
||||||
selfLink := meta.GetSelfLink()
|
selfLink := meta.GetSelfLink()
|
||||||
if len(selfLink) == 0 {
|
if len(selfLink) == 0 {
|
||||||
@ -111,9 +105,9 @@ func GetPartialReference(obj runtime.Object, fieldPath string) (*ObjectReference
|
|||||||
|
|
||||||
// IsAnAPIObject allows clients to preemptively get a reference to an API object and pass it to places that
|
// IsAnAPIObject allows clients to preemptively get a reference to an API object and pass it to places that
|
||||||
// intend only to get a reference to that object. This simplifies the event recording interface.
|
// intend only to get a reference to that object. This simplifies the event recording interface.
|
||||||
func (obj *ObjectReference) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (obj *ObjectReference) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
func (obj *ObjectReference) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (obj *ObjectReference) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
||||||
}
|
}
|
||||||
|
@ -259,11 +259,11 @@ func (gvk *GroupVersionKind) ToAPIVersionAndKind() (string, string) {
|
|||||||
// do not use TypeMeta. This method exists to support test types and legacy serializations
|
// do not use TypeMeta. This method exists to support test types and legacy serializations
|
||||||
// that have a distinct group and kind.
|
// that have a distinct group and kind.
|
||||||
// TODO: further reduce usage of this method.
|
// TODO: further reduce usage of this method.
|
||||||
func FromAPIVersionAndKind(apiVersion, kind string) *GroupVersionKind {
|
func FromAPIVersionAndKind(apiVersion, kind string) GroupVersionKind {
|
||||||
if gv, err := ParseGroupVersion(apiVersion); err == nil {
|
if gv, err := ParseGroupVersion(apiVersion); err == nil {
|
||||||
return &GroupVersionKind{Group: gv.Group, Version: gv.Version, Kind: kind}
|
return GroupVersionKind{Group: gv.Group, Version: gv.Version, Kind: kind}
|
||||||
}
|
}
|
||||||
return &GroupVersionKind{Kind: kind}
|
return GroupVersionKind{Kind: kind}
|
||||||
}
|
}
|
||||||
|
|
||||||
// All objects that are serialized from a Scheme encode their type information. This interface is used
|
// All objects that are serialized from a Scheme encode their type information. This interface is used
|
||||||
@ -273,10 +273,10 @@ func FromAPIVersionAndKind(apiVersion, kind string) *GroupVersionKind {
|
|||||||
type ObjectKind interface {
|
type ObjectKind interface {
|
||||||
// SetGroupVersionKind sets or clears the intended serialized kind of an object. Passing kind nil
|
// SetGroupVersionKind sets or clears the intended serialized kind of an object. Passing kind nil
|
||||||
// should clear the current setting.
|
// should clear the current setting.
|
||||||
SetGroupVersionKind(kind *GroupVersionKind)
|
SetGroupVersionKind(kind GroupVersionKind)
|
||||||
// GroupVersionKind returns the stored group, version, and kind of an object, or nil if the object does
|
// GroupVersionKind returns the stored group, version, and kind of an object, or nil if the object does
|
||||||
// not expose or provide these fields.
|
// not expose or provide these fields.
|
||||||
GroupVersionKind() *GroupVersionKind
|
GroupVersionKind() GroupVersionKind
|
||||||
}
|
}
|
||||||
|
|
||||||
// EmptyObjectKind implements the ObjectKind interface as a noop
|
// EmptyObjectKind implements the ObjectKind interface as a noop
|
||||||
@ -286,7 +286,7 @@ var EmptyObjectKind = emptyObjectKind{}
|
|||||||
type emptyObjectKind struct{}
|
type emptyObjectKind struct{}
|
||||||
|
|
||||||
// SetGroupVersionKind implements the ObjectKind interface
|
// SetGroupVersionKind implements the ObjectKind interface
|
||||||
func (emptyObjectKind) SetGroupVersionKind(gvk *GroupVersionKind) {}
|
func (emptyObjectKind) SetGroupVersionKind(gvk GroupVersionKind) {}
|
||||||
|
|
||||||
// GroupVersionKind implements the ObjectKind interface
|
// GroupVersionKind implements the ObjectKind interface
|
||||||
func (emptyObjectKind) GroupVersionKind() *GroupVersionKind { return nil }
|
func (emptyObjectKind) GroupVersionKind() GroupVersionKind { return GroupVersionKind{} }
|
||||||
|
@ -25,12 +25,12 @@ func Kind(kind string) GroupKind {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetGroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta
|
// SetGroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta
|
||||||
func (obj *TypeMeta) SetGroupVersionKind(gvk *GroupVersionKind) {
|
func (obj *TypeMeta) SetGroupVersionKind(gvk GroupVersionKind) {
|
||||||
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta
|
// GroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta
|
||||||
func (obj *TypeMeta) GroupVersionKind() *GroupVersionKind {
|
func (obj *TypeMeta) GroupVersionKind() GroupVersionKind {
|
||||||
return FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
return FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ func validateOwnerReference(ownerReference api.OwnerReference, fldPath *field.Pa
|
|||||||
if len(ownerReference.UID) == 0 {
|
if len(ownerReference.UID) == 0 {
|
||||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("uid"), ownerReference.UID, "uid must not be empty"))
|
allErrs = append(allErrs, field.Invalid(fldPath.Child("uid"), ownerReference.UID, "uid must not be empty"))
|
||||||
}
|
}
|
||||||
if _, ok := BannedOwners[*gvk]; ok {
|
if _, ok := BannedOwners[gvk]; ok {
|
||||||
allErrs = append(allErrs, field.Invalid(fldPath, ownerReference, fmt.Sprintf("%s is disallowed from being an owner", gvk)))
|
allErrs = append(allErrs, field.Invalid(fldPath, ownerReference, fmt.Sprintf("%s is disallowed from being an owner", gvk)))
|
||||||
}
|
}
|
||||||
return allErrs
|
return allErrs
|
||||||
|
@ -264,7 +264,7 @@ func (c stripVersionEncoder) EncodeToStream(obj runtime.Object, w io.Writer, ove
|
|||||||
}
|
}
|
||||||
gvk.Group = ""
|
gvk.Group = ""
|
||||||
gvk.Version = ""
|
gvk.Version = ""
|
||||||
roundTrippedObj.GetObjectKind().SetGroupVersionKind(gvk)
|
roundTrippedObj.GetObjectKind().SetGroupVersionKind(*gvk)
|
||||||
return c.serializer.EncodeToStream(roundTrippedObj, w)
|
return c.serializer.EncodeToStream(roundTrippedObj, w)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,9 +35,9 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (obj *Config) GetObjectKind() unversioned.ObjectKind { return obj }
|
func (obj *Config) GetObjectKind() unversioned.ObjectKind { return obj }
|
||||||
func (obj *Config) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (obj *Config) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
func (obj *Config) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (obj *Config) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
||||||
}
|
}
|
||||||
|
@ -32,9 +32,9 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (obj *Config) GetObjectKind() unversioned.ObjectKind { return obj }
|
func (obj *Config) GetObjectKind() unversioned.ObjectKind { return obj }
|
||||||
func (obj *Config) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (obj *Config) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
func (obj *Config) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (obj *Config) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
||||||
}
|
}
|
||||||
|
@ -87,24 +87,24 @@ type ExternalType2 struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (obj *internalType) GetObjectKind() unversioned.ObjectKind { return obj }
|
func (obj *internalType) GetObjectKind() unversioned.ObjectKind { return obj }
|
||||||
func (obj *internalType) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (obj *internalType) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
func (obj *internalType) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (obj *internalType) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
||||||
}
|
}
|
||||||
func (obj *externalType) GetObjectKind() unversioned.ObjectKind { return obj }
|
func (obj *externalType) GetObjectKind() unversioned.ObjectKind { return obj }
|
||||||
func (obj *externalType) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (obj *externalType) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
func (obj *externalType) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (obj *externalType) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
||||||
}
|
}
|
||||||
func (obj *ExternalType2) GetObjectKind() unversioned.ObjectKind { return obj }
|
func (obj *ExternalType2) GetObjectKind() unversioned.ObjectKind { return obj }
|
||||||
func (obj *ExternalType2) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (obj *ExternalType2) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
func (obj *ExternalType2) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (obj *ExternalType2) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,12 +21,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// SetGroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta
|
// SetGroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta
|
||||||
func (obj *TypeMeta) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (obj *TypeMeta) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta
|
// GroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta
|
||||||
func (obj *TypeMeta) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (obj *TypeMeta) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,9 +535,9 @@ func (s *Scheme) generateConvertMeta(srcGroupVersion, destGroupVersion unversion
|
|||||||
func setTargetVersion(obj Object, raw *Scheme, gv unversioned.GroupVersion) {
|
func setTargetVersion(obj Object, raw *Scheme, gv unversioned.GroupVersion) {
|
||||||
if gv.Version == APIVersionInternal {
|
if gv.Version == APIVersionInternal {
|
||||||
// internal is a special case
|
// internal is a special case
|
||||||
obj.GetObjectKind().SetGroupVersionKind(nil)
|
obj.GetObjectKind().SetGroupVersionKind(unversioned.GroupVersionKind{})
|
||||||
} else {
|
return
|
||||||
gvk, _ := raw.ObjectKind(obj)
|
|
||||||
obj.GetObjectKind().SetGroupVersionKind(&unversioned.GroupVersionKind{Group: gv.Group, Version: gv.Version, Kind: gvk.Kind})
|
|
||||||
}
|
}
|
||||||
|
gvk, _ := raw.ObjectKind(obj)
|
||||||
|
obj.GetObjectKind().SetGroupVersionKind(unversioned.GroupVersionKind{Group: gv.Group, Version: gv.Version, Kind: gvk.Kind})
|
||||||
}
|
}
|
||||||
|
@ -65,24 +65,12 @@ func TestScheme(t *testing.T) {
|
|||||||
// Register functions to verify that scope.Meta() gets set correctly.
|
// Register functions to verify that scope.Meta() gets set correctly.
|
||||||
err := scheme.AddConversionFuncs(
|
err := scheme.AddConversionFuncs(
|
||||||
func(in *InternalSimple, out *ExternalSimple, scope conversion.Scope) error {
|
func(in *InternalSimple, out *ExternalSimple, scope conversion.Scope) error {
|
||||||
if e, a := internalGV.String(), scope.Meta().SrcVersion; e != a {
|
|
||||||
t.Errorf("Expected '%v', got '%v'", e, a)
|
|
||||||
}
|
|
||||||
if e, a := externalGV.String(), scope.Meta().DestVersion; e != a {
|
|
||||||
t.Errorf("Expected '%v', got '%v'", e, a)
|
|
||||||
}
|
|
||||||
scope.Convert(&in.TypeMeta, &out.TypeMeta, 0)
|
scope.Convert(&in.TypeMeta, &out.TypeMeta, 0)
|
||||||
scope.Convert(&in.TestString, &out.TestString, 0)
|
scope.Convert(&in.TestString, &out.TestString, 0)
|
||||||
internalToExternalCalls++
|
internalToExternalCalls++
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
func(in *ExternalSimple, out *InternalSimple, scope conversion.Scope) error {
|
func(in *ExternalSimple, out *InternalSimple, scope conversion.Scope) error {
|
||||||
if e, a := externalGV.String(), scope.Meta().SrcVersion; e != a {
|
|
||||||
t.Errorf("Expected '%v', got '%v'", e, a)
|
|
||||||
}
|
|
||||||
if e, a := internalGV.String(), scope.Meta().DestVersion; e != a {
|
|
||||||
t.Errorf("Expected '%v', got '%v'", e, a)
|
|
||||||
}
|
|
||||||
scope.Convert(&in.TypeMeta, &out.TypeMeta, 0)
|
scope.Convert(&in.TypeMeta, &out.TypeMeta, 0)
|
||||||
scope.Convert(&in.TestString, &out.TestString, 0)
|
scope.Convert(&in.TestString, &out.TestString, 0)
|
||||||
externalToInternalCalls++
|
externalToInternalCalls++
|
||||||
@ -472,10 +460,10 @@ type ExternalInternalSame struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (obj *MyWeirdCustomEmbeddedVersionKindField) GetObjectKind() unversioned.ObjectKind { return obj }
|
func (obj *MyWeirdCustomEmbeddedVersionKindField) GetObjectKind() unversioned.ObjectKind { return obj }
|
||||||
func (obj *MyWeirdCustomEmbeddedVersionKindField) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (obj *MyWeirdCustomEmbeddedVersionKindField) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
obj.APIVersion, obj.ObjectKind = gvk.ToAPIVersionAndKind()
|
obj.APIVersion, obj.ObjectKind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
func (obj *MyWeirdCustomEmbeddedVersionKindField) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (obj *MyWeirdCustomEmbeddedVersionKindField) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.ObjectKind)
|
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.ObjectKind)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,10 +129,10 @@ var TestObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 100).Funcs(
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (obj *MyWeirdCustomEmbeddedVersionKindField) GetObjectKind() unversioned.ObjectKind { return obj }
|
func (obj *MyWeirdCustomEmbeddedVersionKindField) GetObjectKind() unversioned.ObjectKind { return obj }
|
||||||
func (obj *MyWeirdCustomEmbeddedVersionKindField) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (obj *MyWeirdCustomEmbeddedVersionKindField) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
obj.APIVersion, obj.ObjectKind = gvk.ToAPIVersionAndKind()
|
obj.APIVersion, obj.ObjectKind = gvk.ToAPIVersionAndKind()
|
||||||
}
|
}
|
||||||
func (obj *MyWeirdCustomEmbeddedVersionKindField) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (obj *MyWeirdCustomEmbeddedVersionKindField) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.ObjectKind)
|
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.ObjectKind)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ func (s *Serializer) Decode(originalData []byte, gvk *unversioned.GroupVersionKi
|
|||||||
if unk, ok := into.(*runtime.Unknown); ok && unk != nil {
|
if unk, ok := into.(*runtime.Unknown); ok && unk != nil {
|
||||||
unk.Raw = originalData
|
unk.Raw = originalData
|
||||||
unk.ContentType = runtime.ContentTypeJSON
|
unk.ContentType = runtime.ContentTypeJSON
|
||||||
unk.GetObjectKind().SetGroupVersionKind(actual)
|
unk.GetObjectKind().SetGroupVersionKind(*actual)
|
||||||
return unk, actual, nil
|
return unk, actual, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,12 +31,12 @@ import (
|
|||||||
type testDecodable struct {
|
type testDecodable struct {
|
||||||
Other string
|
Other string
|
||||||
Value int `json:"value"`
|
Value int `json:"value"`
|
||||||
gvk *unversioned.GroupVersionKind
|
gvk unversioned.GroupVersionKind
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *testDecodable) GetObjectKind() unversioned.ObjectKind { return d }
|
func (d *testDecodable) GetObjectKind() unversioned.ObjectKind { return d }
|
||||||
func (d *testDecodable) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) { d.gvk = gvk }
|
func (d *testDecodable) SetGroupVersionKind(gvk unversioned.GroupVersionKind) { d.gvk = gvk }
|
||||||
func (d *testDecodable) GroupVersionKind() *unversioned.GroupVersionKind { return d.gvk }
|
func (d *testDecodable) GroupVersionKind() unversioned.GroupVersionKind { return d.gvk }
|
||||||
|
|
||||||
func TestDecode(t *testing.T) {
|
func TestDecode(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
@ -79,9 +79,7 @@ func TestDecode(t *testing.T) {
|
|||||||
data: []byte("{}"),
|
data: []byte("{}"),
|
||||||
defaultGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"},
|
defaultGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"},
|
||||||
creater: &mockCreater{obj: &testDecodable{}},
|
creater: &mockCreater{obj: &testDecodable{}},
|
||||||
expectedObject: &testDecodable{
|
expectedObject: &testDecodable{},
|
||||||
gvk: nil, // json serializer does NOT set GVK
|
|
||||||
},
|
|
||||||
expectedGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"},
|
expectedGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -90,9 +88,7 @@ func TestDecode(t *testing.T) {
|
|||||||
data: []byte(`{"apiVersion":"blah"}`),
|
data: []byte(`{"apiVersion":"blah"}`),
|
||||||
defaultGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"},
|
defaultGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"},
|
||||||
creater: &mockCreater{obj: &testDecodable{}},
|
creater: &mockCreater{obj: &testDecodable{}},
|
||||||
expectedObject: &testDecodable{
|
expectedObject: &testDecodable{},
|
||||||
gvk: nil, // json serializer does NOT set GVK
|
|
||||||
},
|
|
||||||
expectedGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "", Version: "blah"},
|
expectedGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "", Version: "blah"},
|
||||||
},
|
},
|
||||||
// group without version is defaulted
|
// group without version is defaulted
|
||||||
@ -100,9 +96,7 @@ func TestDecode(t *testing.T) {
|
|||||||
data: []byte(`{"apiVersion":"other/"}`),
|
data: []byte(`{"apiVersion":"other/"}`),
|
||||||
defaultGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"},
|
defaultGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"},
|
||||||
creater: &mockCreater{obj: &testDecodable{}},
|
creater: &mockCreater{obj: &testDecodable{}},
|
||||||
expectedObject: &testDecodable{
|
expectedObject: &testDecodable{},
|
||||||
gvk: nil, // json serializer does NOT set GVK
|
|
||||||
},
|
|
||||||
expectedGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"},
|
expectedGVK: &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -120,14 +120,14 @@ func (s *Serializer) Decode(originalData []byte, gvk *unversioned.GroupVersionKi
|
|||||||
}
|
}
|
||||||
|
|
||||||
actual := unk.GroupVersionKind()
|
actual := unk.GroupVersionKind()
|
||||||
copyKindDefaults(actual, gvk)
|
copyKindDefaults(&actual, gvk)
|
||||||
|
|
||||||
if intoUnknown, ok := into.(*runtime.Unknown); ok && intoUnknown != nil {
|
if intoUnknown, ok := into.(*runtime.Unknown); ok && intoUnknown != nil {
|
||||||
*intoUnknown = unk
|
*intoUnknown = unk
|
||||||
if len(intoUnknown.ContentType) == 0 {
|
if len(intoUnknown.ContentType) == 0 {
|
||||||
intoUnknown.ContentType = s.contentType
|
intoUnknown.ContentType = s.contentType
|
||||||
}
|
}
|
||||||
return intoUnknown, actual, nil
|
return intoUnknown, &actual, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if into != nil {
|
if into != nil {
|
||||||
@ -136,16 +136,16 @@ func (s *Serializer) Decode(originalData []byte, gvk *unversioned.GroupVersionKi
|
|||||||
case runtime.IsNotRegisteredError(err):
|
case runtime.IsNotRegisteredError(err):
|
||||||
pb, ok := into.(proto.Message)
|
pb, ok := into.(proto.Message)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, actual, errNotMarshalable{reflect.TypeOf(into)}
|
return nil, &actual, errNotMarshalable{reflect.TypeOf(into)}
|
||||||
}
|
}
|
||||||
if err := proto.Unmarshal(unk.Raw, pb); err != nil {
|
if err := proto.Unmarshal(unk.Raw, pb); err != nil {
|
||||||
return nil, actual, err
|
return nil, &actual, err
|
||||||
}
|
}
|
||||||
return into, actual, nil
|
return into, &actual, nil
|
||||||
case err != nil:
|
case err != nil:
|
||||||
return nil, actual, err
|
return nil, &actual, err
|
||||||
default:
|
default:
|
||||||
copyKindDefaults(actual, typed)
|
copyKindDefaults(&actual, typed)
|
||||||
// if the result of defaulting did not set a version or group, ensure that at least group is set
|
// if the result of defaulting did not set a version or group, ensure that at least group is set
|
||||||
// (copyKindDefaults will not assign Group if version is already set). This guarantees that the group
|
// (copyKindDefaults will not assign Group if version is already set). This guarantees that the group
|
||||||
// of into is set if there is no better information from the caller or object.
|
// of into is set if there is no better information from the caller or object.
|
||||||
@ -156,26 +156,25 @@ func (s *Serializer) Decode(originalData []byte, gvk *unversioned.GroupVersionKi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(actual.Kind) == 0 {
|
if len(actual.Kind) == 0 {
|
||||||
return nil, actual, runtime.NewMissingKindErr(fmt.Sprintf("%#v", unk.TypeMeta))
|
return nil, &actual, runtime.NewMissingKindErr(fmt.Sprintf("%#v", unk.TypeMeta))
|
||||||
}
|
}
|
||||||
if len(actual.Version) == 0 {
|
if len(actual.Version) == 0 {
|
||||||
return nil, actual, runtime.NewMissingVersionErr(fmt.Sprintf("%#v", unk.TypeMeta))
|
return nil, &actual, runtime.NewMissingVersionErr(fmt.Sprintf("%#v", unk.TypeMeta))
|
||||||
}
|
}
|
||||||
|
|
||||||
return unmarshalToObject(s.typer, s.creater, actual, into, unk.Raw)
|
return unmarshalToObject(s.typer, s.creater, &actual, into, unk.Raw)
|
||||||
}
|
}
|
||||||
|
|
||||||
// EncodeToStream serializes the provided object to the given writer. Overrides is ignored.
|
// EncodeToStream serializes the provided object to the given writer. Overrides is ignored.
|
||||||
func (s *Serializer) EncodeToStream(obj runtime.Object, w io.Writer, overrides ...unversioned.GroupVersion) error {
|
func (s *Serializer) EncodeToStream(obj runtime.Object, w io.Writer, overrides ...unversioned.GroupVersion) error {
|
||||||
var unk runtime.Unknown
|
var unk runtime.Unknown
|
||||||
if kind := obj.GetObjectKind().GroupVersionKind(); kind != nil {
|
kind := obj.GetObjectKind().GroupVersionKind()
|
||||||
unk = runtime.Unknown{
|
unk = runtime.Unknown{
|
||||||
TypeMeta: runtime.TypeMeta{
|
TypeMeta: runtime.TypeMeta{
|
||||||
Kind: kind.Kind,
|
Kind: kind.Kind,
|
||||||
APIVersion: kind.GroupVersion().String(),
|
APIVersion: kind.GroupVersion().String(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
prefixSize := uint64(len(s.prefix))
|
prefixSize := uint64(len(s.prefix))
|
||||||
|
|
||||||
@ -334,7 +333,7 @@ func (s *RawSerializer) Decode(originalData []byte, gvk *unversioned.GroupVersio
|
|||||||
intoUnknown.Raw = data
|
intoUnknown.Raw = data
|
||||||
intoUnknown.ContentEncoding = ""
|
intoUnknown.ContentEncoding = ""
|
||||||
intoUnknown.ContentType = s.contentType
|
intoUnknown.ContentType = s.contentType
|
||||||
intoUnknown.SetGroupVersionKind(actual)
|
intoUnknown.SetGroupVersionKind(*actual)
|
||||||
return intoUnknown, actual, nil
|
return intoUnknown, actual, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,12 +34,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type testObject struct {
|
type testObject struct {
|
||||||
gvk *unversioned.GroupVersionKind
|
gvk unversioned.GroupVersionKind
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *testObject) GetObjectKind() unversioned.ObjectKind { return d }
|
func (d *testObject) GetObjectKind() unversioned.ObjectKind { return d }
|
||||||
func (d *testObject) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) { d.gvk = gvk }
|
func (d *testObject) SetGroupVersionKind(gvk unversioned.GroupVersionKind) { d.gvk = gvk }
|
||||||
func (d *testObject) GroupVersionKind() *unversioned.GroupVersionKind { return d.gvk }
|
func (d *testObject) GroupVersionKind() unversioned.GroupVersionKind { return d.gvk }
|
||||||
|
|
||||||
type testMarshalable struct {
|
type testMarshalable struct {
|
||||||
testObject
|
testObject
|
||||||
@ -106,7 +106,7 @@ func TestEncode(t *testing.T) {
|
|||||||
0x22, 0x00, // content-encoding
|
0x22, 0x00, // content-encoding
|
||||||
}
|
}
|
||||||
obj2 := &testMarshalable{
|
obj2 := &testMarshalable{
|
||||||
testObject: testObject{gvk: &unversioned.GroupVersionKind{Kind: "test", Group: "other", Version: "version"}},
|
testObject: testObject{gvk: unversioned.GroupVersionKind{Kind: "test", Group: "other", Version: "version"}},
|
||||||
data: []byte{0x01, 0x02, 0x03},
|
data: []byte{0x01, 0x02, 0x03},
|
||||||
}
|
}
|
||||||
wire2 := []byte{
|
wire2 := []byte{
|
||||||
|
@ -227,10 +227,12 @@ func (c *codec) EncodeToStream(obj runtime.Object, w io.Writer, overrides ...unv
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (c.encodeVersion == nil && len(overrides) == 0) || isUnversioned {
|
if (c.encodeVersion == nil && len(overrides) == 0) || isUnversioned {
|
||||||
old := obj.GetObjectKind().GroupVersionKind()
|
objectKind := obj.GetObjectKind()
|
||||||
obj.GetObjectKind().SetGroupVersionKind(gvk)
|
old := objectKind.GroupVersionKind()
|
||||||
defer obj.GetObjectKind().SetGroupVersionKind(old)
|
objectKind.SetGroupVersionKind(*gvk)
|
||||||
return c.encoder.EncodeToStream(obj, w, overrides...)
|
err = c.encoder.EncodeToStream(obj, w, overrides...)
|
||||||
|
objectKind.SetGroupVersionKind(old)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
targetGV, ok := c.encodeVersion[gvk.Group]
|
targetGV, ok := c.encodeVersion[gvk.Group]
|
||||||
@ -270,13 +272,14 @@ func (c *codec) EncodeToStream(obj runtime.Object, w io.Writer, overrides ...unv
|
|||||||
} else {
|
} else {
|
||||||
obj = out
|
obj = out
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
old := obj.GetObjectKind().GroupVersionKind()
|
|
||||||
defer obj.GetObjectKind().SetGroupVersionKind(old)
|
|
||||||
obj.GetObjectKind().SetGroupVersionKind(&unversioned.GroupVersionKind{Group: targetGV.Group, Version: targetGV.Version, Kind: gvk.Kind})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.encoder.EncodeToStream(obj, w, overrides...)
|
objectKind := obj.GetObjectKind()
|
||||||
|
old := objectKind.GroupVersionKind()
|
||||||
|
objectKind.SetGroupVersionKind(unversioned.GroupVersionKind{Group: targetGV.Group, Version: targetGV.Version, Kind: gvk.Kind})
|
||||||
|
err = c.encoder.EncodeToStream(obj, w, overrides...)
|
||||||
|
objectKind.SetGroupVersionKind(old)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// promoteOrPrependGroupVersion finds the group version in the provided group versions that has the same group as target.
|
// promoteOrPrependGroupVersion finds the group version in the provided group versions that has the same group as target.
|
||||||
|
@ -30,12 +30,12 @@ import (
|
|||||||
type testDecodable struct {
|
type testDecodable struct {
|
||||||
Other string
|
Other string
|
||||||
Value int `json:"value"`
|
Value int `json:"value"`
|
||||||
gvk *unversioned.GroupVersionKind
|
gvk unversioned.GroupVersionKind
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *testDecodable) GetObjectKind() unversioned.ObjectKind { return d }
|
func (d *testDecodable) GetObjectKind() unversioned.ObjectKind { return d }
|
||||||
func (d *testDecodable) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) { d.gvk = gvk }
|
func (d *testDecodable) SetGroupVersionKind(gvk unversioned.GroupVersionKind) { d.gvk = gvk }
|
||||||
func (d *testDecodable) GroupVersionKind() *unversioned.GroupVersionKind { return d.gvk }
|
func (d *testDecodable) GroupVersionKind() unversioned.GroupVersionKind { return d.gvk }
|
||||||
|
|
||||||
func TestDecode(t *testing.T) {
|
func TestDecode(t *testing.T) {
|
||||||
gvk1 := &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"}
|
gvk1 := &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"}
|
||||||
|
@ -301,18 +301,18 @@ func (u *Unstructured) SetAnnotations(annotations map[string]string) {
|
|||||||
u.setNestedMap(annotations, "metadata", "annotations")
|
u.setNestedMap(annotations, "metadata", "annotations")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (u *Unstructured) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
u.SetAPIVersion(gvk.GroupVersion().String())
|
u.SetAPIVersion(gvk.GroupVersion().String())
|
||||||
u.SetKind(gvk.Kind)
|
u.SetKind(gvk.Kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (u *Unstructured) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
gv, err := unversioned.ParseGroupVersion(u.GetAPIVersion())
|
gv, err := unversioned.ParseGroupVersion(u.GetAPIVersion())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return unversioned.GroupVersionKind{}
|
||||||
}
|
}
|
||||||
gvk := gv.WithKind(u.GetKind())
|
gvk := gv.WithKind(u.GetKind())
|
||||||
return &gvk
|
return gvk
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnstructuredList allows lists that do not have Golang structs
|
// UnstructuredList allows lists that do not have Golang structs
|
||||||
@ -364,18 +364,18 @@ func (u *UnstructuredList) SetSelfLink(selfLink string) {
|
|||||||
u.setNestedField(selfLink, "metadata", "selfLink")
|
u.setNestedField(selfLink, "metadata", "selfLink")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UnstructuredList) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) {
|
func (u *UnstructuredList) SetGroupVersionKind(gvk unversioned.GroupVersionKind) {
|
||||||
u.SetAPIVersion(gvk.GroupVersion().String())
|
u.SetAPIVersion(gvk.GroupVersion().String())
|
||||||
u.SetKind(gvk.Kind)
|
u.SetKind(gvk.Kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UnstructuredList) GroupVersionKind() *unversioned.GroupVersionKind {
|
func (u *UnstructuredList) GroupVersionKind() unversioned.GroupVersionKind {
|
||||||
gv, err := unversioned.ParseGroupVersion(u.GetAPIVersion())
|
gv, err := unversioned.ParseGroupVersion(u.GetAPIVersion())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return unversioned.GroupVersionKind{}
|
||||||
}
|
}
|
||||||
gvk := gv.WithKind(u.GetKind())
|
gvk := gv.WithKind(u.GetKind())
|
||||||
return &gvk
|
return gvk
|
||||||
}
|
}
|
||||||
|
|
||||||
// VersionedObjects is used by Decoders to give callers a way to access all versions
|
// VersionedObjects is used by Decoders to give callers a way to access all versions
|
||||||
|
@ -45,10 +45,10 @@ func (s unstructuredJSONScheme) Decode(data []byte, _ *unversioned.GroupVersionK
|
|||||||
|
|
||||||
gvk := obj.GetObjectKind().GroupVersionKind()
|
gvk := obj.GetObjectKind().GroupVersionKind()
|
||||||
if len(gvk.Kind) == 0 {
|
if len(gvk.Kind) == 0 {
|
||||||
return nil, gvk, NewMissingKindErr(string(data))
|
return nil, &gvk, NewMissingKindErr(string(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj, gvk, nil
|
return obj, &gvk, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (unstructuredJSONScheme) EncodeToStream(obj Object, w io.Writer, overrides ...unversioned.GroupVersion) error {
|
func (unstructuredJSONScheme) EncodeToStream(obj Object, w io.Writer, overrides ...unversioned.GroupVersion) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user