From 7123f30783fe99c3401182bfb22d2ff3acc1bff5 Mon Sep 17 00:00:00 2001 From: Avesh Agarwal Date: Tue, 9 Jan 2018 01:09:21 -0500 Subject: [PATCH] Update auto-generated code. --- pkg/api/types.generated.go | 515 ++++++++---------- pkg/api/v1alpha1/types.generated.go | 500 ++++++++--------- pkg/api/v1alpha1/zz_generated.conversion.go | 7 +- pkg/api/v1alpha1/zz_generated.deepcopy.go | 157 +++--- pkg/api/v1alpha1/zz_generated.defaults.go | 2 +- pkg/api/zz_generated.deepcopy.go | 157 +++--- pkg/apis/componentconfig/types.generated.go | 190 ++++--- .../v1alpha1/types.generated.go | 194 ++++--- .../v1alpha1/zz_generated.conversion.go | 7 +- .../v1alpha1/zz_generated.deepcopy.go | 36 +- .../v1alpha1/zz_generated.defaults.go | 2 +- .../componentconfig/zz_generated.deepcopy.go | 36 +- 12 files changed, 876 insertions(+), 927 deletions(-) diff --git a/pkg/api/types.generated.go b/pkg/api/types.generated.go index 1f9828897..c2e9b4a47 100644 --- a/pkg/api/types.generated.go +++ b/pkg/api/types.generated.go @@ -14,10 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ +// Code generated by codecgen - DO NOT EDIT. package api @@ -25,44 +22,42 @@ import ( "errors" "fmt" codec1978 "github.com/ugorji/go/codec" + pkg2_v1 "k8s.io/api/core/v1" pkg1_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkg2_v1 "k8s.io/kubernetes/pkg/api/v1" "reflect" "runtime" ) const ( // ----- content types ---- - codecSelferC_UTF81234 = 1 - codecSelferC_RAW1234 = 0 + codecSelferCcUTF81234 = 1 + codecSelferCcRAW1234 = 0 // ----- value types used ---- - codecSelferValueTypeArray1234 = 10 - codecSelferValueTypeMap1234 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey1234 = 2 - codecSelfer_containerMapValue1234 = 3 - codecSelfer_containerMapEnd1234 = 4 - codecSelfer_containerArrayElem1234 = 6 - codecSelfer_containerArrayEnd1234 = 7 + codecSelferValueTypeArray1234 = 10 + codecSelferValueTypeMap1234 = 9 + codecSelferValueTypeString1234 = 6 + codecSelferValueTypeInt1234 = 2 + codecSelferValueTypeUint1234 = 3 + codecSelferValueTypeFloat1234 = 4 ) var ( codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`) + errCodecSelferOnlyMapOrArrayEncodeToStruct1234 = errors.New(`only encoded map or array can be decoded into a struct`) ) type codecSelfer1234 struct{} func init() { - if codec1978.GenVersion != 5 { + if codec1978.GenVersion != 8 { _, file, _, _ := runtime.Caller(0) err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) + 8, codec1978.GenVersion, file) panic(err) } if false { // reference the types, but skip this branch at build/run time - var v0 pkg1_v1.TypeMeta - var v1 pkg2_v1.ResourceName + var v0 pkg2_v1.ResourceName + var v1 pkg1_v1.TypeMeta _, _ = v0, v1 } } @@ -77,89 +72,90 @@ func (x *DeschedulerPolicy) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 + _ = yyq2 + _, _ = yysep2, yy2arr2 const yyr2 bool = false yyq2[0] = x.Kind != "" yyq2[1] = x.APIVersion != "" - var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) + r.WriteArrayStart(3) } else { - yynn2 = 1 + var yynn2 = 1 for _, b := range yyq2 { if b { yynn2++ } } - r.EncodeMapStart(yynn2) + r.WriteMapStart(yynn2) yynn2 = 0 } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[0] { yym4 := z.EncBinary() _ = yym4 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + r.EncodeString(codecSelferCcUTF81234, string(x.Kind)) } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferCcUTF81234, "") } } else { if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `kind`) + r.WriteMapElemValue() yym5 := z.EncBinary() _ = yym5 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + r.EncodeString(codecSelferCcUTF81234, string(x.Kind)) } } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[1] { yym7 := z.EncBinary() _ = yym7 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferCcUTF81234, string(x.APIVersion)) } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferCcUTF81234, "") } } else { if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `apiVersion`) + r.WriteMapElemValue() yym8 := z.EncBinary() _ = yym8 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferCcUTF81234, string(x.APIVersion)) } } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if x.Strategies == nil { r.EncodeNil() } else { x.Strategies.CodecEncodeSelf(e) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Strategies")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `Strategies`) + r.WriteMapElemValue() if x.Strategies == nil { r.EncodeNil() } else { @@ -167,9 +163,9 @@ func (x *DeschedulerPolicy) CodecEncodeSelf(e *codec1978.Encoder) { } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + r.WriteArrayEnd() } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } } } @@ -182,25 +178,26 @@ func (x *DeschedulerPolicy) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { yyct2 := r.ContainerType() if yyct2 == codecSelferValueTypeMap1234 { yyl2 := r.ReadMapStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } else { x.codecDecodeSelfFromMap(yyl2, d) } } else if yyct2 == codecSelferValueTypeArray1234 { yyl2 := r.ReadArrayStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } else { x.codecDecodeSelfFromArray(yyl2, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct1234) } } } @@ -209,8 +206,6 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc var yyhl3 bool = l >= 0 for yyj3 := 0; ; yyj3++ { if yyhl3 { @@ -222,10 +217,9 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) break } } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemKey() + yys3 := z.StringView(r.DecStructFieldKey(codecSelferValueTypeString1234, z.DecScratchArrayBuffer())) + r.ReadMapElemValue() switch yys3 { case "kind": if r.TryDecodeAsNil() { @@ -262,7 +256,7 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x *DeschedulerPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { @@ -279,10 +273,10 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -301,10 +295,10 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.APIVersion = "" } else { @@ -323,10 +317,10 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Strategies = nil } else { @@ -343,10 +337,10 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder if yyb9 { break } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() z.DecStructFieldNotFound(yyj9-1, "") } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } func (x StrategyName) CodecEncodeSelf(e *codec1978.Encoder) { @@ -356,9 +350,10 @@ func (x StrategyName) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) + r.EncodeString(codecSelferCcUTF81234, string(x)) } } @@ -369,7 +364,8 @@ func (x *StrategyName) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { *((*string)(x)) = r.DecodeString() } @@ -385,7 +381,8 @@ func (x StrategyList) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { h.encStrategyList((StrategyList)(x), e) } @@ -399,7 +396,8 @@ func (x *StrategyList) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { h.decStrategyList((*StrategyList)(x), d) } @@ -415,28 +413,20 @@ func (x *DeschedulerStrategy) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 + _, _ = yysep2, yy2arr2 const yyr2 bool = false - var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) + r.WriteArrayStart(3) } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 + r.WriteMapStart(3) } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() yym4 := z.EncBinary() _ = yym4 if false { @@ -444,9 +434,9 @@ func (x *DeschedulerStrategy) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(bool(x.Enabled)) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Enabled")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `Enabled`) + r.WriteMapElemValue() yym5 := z.EncBinary() _ = yym5 if false { @@ -455,7 +445,7 @@ func (x *DeschedulerStrategy) CodecEncodeSelf(e *codec1978.Encoder) { } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() yym7 := z.EncBinary() _ = yym7 if false { @@ -463,9 +453,9 @@ func (x *DeschedulerStrategy) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(int64(x.Weight)) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Weight")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `Weight`) + r.WriteMapElemValue() yym8 := z.EncBinary() _ = yym8 if false { @@ -474,20 +464,20 @@ func (x *DeschedulerStrategy) CodecEncodeSelf(e *codec1978.Encoder) { } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() yy10 := &x.Params yy10.CodecEncodeSelf(e) } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Params")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `Params`) + r.WriteMapElemValue() yy12 := &x.Params yy12.CodecEncodeSelf(e) } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + r.WriteArrayEnd() } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } } } @@ -500,25 +490,26 @@ func (x *DeschedulerStrategy) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { yyct2 := r.ContainerType() if yyct2 == codecSelferValueTypeMap1234 { yyl2 := r.ReadMapStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } else { x.codecDecodeSelfFromMap(yyl2, d) } } else if yyct2 == codecSelferValueTypeArray1234 { yyl2 := r.ReadArrayStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } else { x.codecDecodeSelfFromArray(yyl2, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct1234) } } } @@ -527,8 +518,6 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc var yyhl3 bool = l >= 0 for yyj3 := 0; ; yyj3++ { if yyhl3 { @@ -540,10 +529,9 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder break } } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemKey() + yys3 := z.StringView(r.DecStructFieldKey(codecSelferValueTypeString1234, z.DecScratchArrayBuffer())) + r.ReadMapElemValue() switch yys3 { case "Enabled": if r.TryDecodeAsNil() { @@ -580,7 +568,7 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x *DeschedulerStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { @@ -597,10 +585,10 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decod yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Enabled = false } else { @@ -619,10 +607,10 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decod yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Weight = 0 } else { @@ -641,10 +629,10 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decod yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Params = StrategyParameters{} } else { @@ -661,10 +649,10 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decod if yyb9 { break } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() z.DecStructFieldNotFound(yyj9-1, "") } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } func (x *StrategyParameters) CodecEncodeSelf(e *codec1978.Encoder) { @@ -677,41 +665,33 @@ func (x *StrategyParameters) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 + _, _ = yysep2, yy2arr2 const yyr2 bool = false - var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) + r.WriteArrayStart(1) } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 + r.WriteMapStart(1) } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() yy4 := &x.NodeResourceUtilizationThresholds yy4.CodecEncodeSelf(e) } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("NodeResourceUtilizationThresholds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `NodeResourceUtilizationThresholds`) + r.WriteMapElemValue() yy6 := &x.NodeResourceUtilizationThresholds yy6.CodecEncodeSelf(e) } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + r.WriteArrayEnd() } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } } } @@ -724,25 +704,26 @@ func (x *StrategyParameters) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { yyct2 := r.ContainerType() if yyct2 == codecSelferValueTypeMap1234 { yyl2 := r.ReadMapStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } else { x.codecDecodeSelfFromMap(yyl2, d) } } else if yyct2 == codecSelferValueTypeArray1234 { yyl2 := r.ReadArrayStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } else { x.codecDecodeSelfFromArray(yyl2, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct1234) } } } @@ -751,8 +732,6 @@ func (x *StrategyParameters) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc var yyhl3 bool = l >= 0 for yyj3 := 0; ; yyj3++ { if yyhl3 { @@ -764,10 +743,9 @@ func (x *StrategyParameters) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) break } } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemKey() + yys3 := z.StringView(r.DecStructFieldKey(codecSelferValueTypeString1234, z.DecScratchArrayBuffer())) + r.ReadMapElemValue() switch yys3 { case "NodeResourceUtilizationThresholds": if r.TryDecodeAsNil() { @@ -780,7 +758,7 @@ func (x *StrategyParameters) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x *StrategyParameters) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { @@ -797,10 +775,10 @@ func (x *StrategyParameters) codecDecodeSelfFromArray(l int, d *codec1978.Decode yyb5 = r.CheckBreak() } if yyb5 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.NodeResourceUtilizationThresholds = NodeResourceUtilizationThresholds{} } else { @@ -817,10 +795,10 @@ func (x *StrategyParameters) codecDecodeSelfFromArray(l int, d *codec1978.Decode if yyb5 { break } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } func (x Percentage) CodecEncodeSelf(e *codec1978.Encoder) { @@ -830,7 +808,8 @@ func (x Percentage) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { r.EncodeFloat64(float64(x)) } @@ -843,9 +822,10 @@ func (x *Percentage) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { - *((*float64)(x)) = float64(r.DecodeFloat(false)) + *((*float64)(x)) = r.DecodeFloat64() } } @@ -859,7 +839,8 @@ func (x ResourceThresholds) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { h.encResourceThresholds((ResourceThresholds)(x), e) } @@ -873,7 +854,8 @@ func (x *ResourceThresholds) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { h.decResourceThresholds((*ResourceThresholds)(x), d) } @@ -889,37 +871,29 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 + _, _ = yysep2, yy2arr2 const yyr2 bool = false - var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) + r.WriteArrayStart(3) } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 + r.WriteMapStart(3) } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if x.Thresholds == nil { r.EncodeNil() } else { x.Thresholds.CodecEncodeSelf(e) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Thresholds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `Thresholds`) + r.WriteMapElemValue() if x.Thresholds == nil { r.EncodeNil() } else { @@ -927,16 +901,16 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if x.TargetThresholds == nil { r.EncodeNil() } else { x.TargetThresholds.CodecEncodeSelf(e) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("TargetThresholds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `TargetThresholds`) + r.WriteMapElemValue() if x.TargetThresholds == nil { r.EncodeNil() } else { @@ -944,7 +918,7 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() yym10 := z.EncBinary() _ = yym10 if false { @@ -952,9 +926,9 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder r.EncodeInt(int64(x.NumberOfNodes)) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("NumberOfNodes")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `NumberOfNodes`) + r.WriteMapElemValue() yym11 := z.EncBinary() _ = yym11 if false { @@ -963,9 +937,9 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + r.WriteArrayEnd() } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } } } @@ -978,25 +952,26 @@ func (x *NodeResourceUtilizationThresholds) CodecDecodeSelf(d *codec1978.Decoder yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { yyct2 := r.ContainerType() if yyct2 == codecSelferValueTypeMap1234 { yyl2 := r.ReadMapStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } else { x.codecDecodeSelfFromMap(yyl2, d) } } else if yyct2 == codecSelferValueTypeArray1234 { yyl2 := r.ReadArrayStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } else { x.codecDecodeSelfFromArray(yyl2, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct1234) } } } @@ -1005,8 +980,6 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromMap(l int, d *cod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc var yyhl3 bool = l >= 0 for yyj3 := 0; ; yyj3++ { if yyhl3 { @@ -1018,10 +991,9 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromMap(l int, d *cod break } } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemKey() + yys3 := z.StringView(r.DecStructFieldKey(codecSelferValueTypeString1234, z.DecScratchArrayBuffer())) + r.ReadMapElemValue() switch yys3 { case "Thresholds": if r.TryDecodeAsNil() { @@ -1053,7 +1025,7 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromMap(l int, d *cod z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { @@ -1070,10 +1042,10 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromArray(l int, d *c yyb8 = r.CheckBreak() } if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Thresholds = nil } else { @@ -1087,10 +1059,10 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromArray(l int, d *c yyb8 = r.CheckBreak() } if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.TargetThresholds = nil } else { @@ -1104,10 +1076,10 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromArray(l int, d *c yyb8 = r.CheckBreak() } if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.NumberOfNodes = 0 } else { @@ -1129,25 +1101,25 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromArray(l int, d *c if yyb8 { break } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() z.DecStructFieldNotFound(yyj8-1, "") } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } func (x codecSelfer1234) encStrategyList(v StrategyList, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.EncodeMapStart(len(v)) + r.WriteMapStart(len(v)) for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.WriteMapElemKey() yyk1.CodecEncodeSelf(e) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemValue() yy3 := &yyv1 yy3.CodecEncodeSelf(e) } - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } func (x codecSelfer1234) decStrategyList(v *StrategyList, d *codec1978.Decoder) { @@ -1159,19 +1131,20 @@ func (x codecSelfer1234) decStrategyList(v *StrategyList, d *codec1978.Decoder) yyl1 := r.ReadMapStart() yybh1 := z.DecBasicHandle() if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 56) + yyrl1 := z.DecInferLen(yyl1, yybh1.MaxInitLen, 56) yyv1 = make(map[StrategyName]DeschedulerStrategy, yyrl1) *v = yyv1 } var yymk1 StrategyName var yymv1 DeschedulerStrategy - var yymg1 bool + var yymg1, yymdn1 bool if yybh1.MapValueReset { yymg1 = true } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) + if yyl1 != 0 { + yyhl1 := yyl1 > 0 + for yyj1 := 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { + r.ReadMapElemKey() if r.TryDecodeAsNil() { yymk1 = "" } else { @@ -1184,62 +1157,48 @@ func (x codecSelfer1234) decStrategyList(v *StrategyList, d *codec1978.Decoder) } else { yymv1 = DeschedulerStrategy{} } - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemValue() + yymdn1 = false if r.TryDecodeAsNil() { - yymv1 = DeschedulerStrategy{} + yymdn1 = true } else { yyv3 := &yymv1 yyv3.CodecDecodeSelf(d) } - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv4 := &yymk1 - yyv4.CodecDecodeSelf(d) - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } else { - yymv1 = DeschedulerStrategy{} - } - z.DecSendContainerState(codecSelfer_containerMapValue1234) - if r.TryDecodeAsNil() { - yymv1 = DeschedulerStrategy{} - } else { - yyv5 := &yymv1 - yyv5.CodecDecodeSelf(d) - } - - if yyv1 != nil { + if yymdn1 { + if yybh1.DeleteOnNilMapValue { + delete(yyv1, yymk1) + } else { + yyv1[yymk1] = DeschedulerStrategy{} + } + } else if yyv1 != nil { yyv1[yymk1] = yymv1 } } } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x codecSelfer1234) encResourceThresholds(v ResourceThresholds, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.EncodeMapStart(len(v)) + r.WriteMapStart(len(v)) for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - yysf2 := &yyk1 - yysf2.CodecEncodeSelf(e) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + yym2 := z.EncBinary() + _ = yym2 + if false { + } else if yyxt2 := z.Extension(z.I2Rtid(yyk1)); yyxt2 != nil { + z.EncExtension(yyk1, yyxt2) + } else { + r.EncodeString(codecSelferCcUTF81234, string(yyk1)) + } + r.WriteMapElemValue() yyv1.CodecEncodeSelf(e) } - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } func (x codecSelfer1234) decResourceThresholds(v *ResourceThresholds, d *codec1978.Decoder) { @@ -1251,65 +1210,55 @@ func (x codecSelfer1234) decResourceThresholds(v *ResourceThresholds, d *codec19 yyl1 := r.ReadMapStart() yybh1 := z.DecBasicHandle() if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 24) + yyrl1 := z.DecInferLen(yyl1, yybh1.MaxInitLen, 24) yyv1 = make(map[pkg2_v1.ResourceName]Percentage, yyrl1) *v = yyv1 } var yymk1 pkg2_v1.ResourceName var yymv1 Percentage - var yymg1 bool + var yymg1, yymdn1 bool if yybh1.MapValueReset { } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) + if yyl1 != 0 { + yyhl1 := yyl1 > 0 + for yyj1 := 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { + r.ReadMapElemKey() if r.TryDecodeAsNil() { yymk1 = "" } else { yyv2 := &yymk1 - yyv2.CodecDecodeSelf(d) + yym3 := z.DecBinary() + _ = yym3 + if false { + } else if yyxt3 := z.Extension(z.I2Rtid(yyv2)); yyxt3 != nil { + z.DecExtension(yyv2, yyxt3) + } else { + *((*string)(yyv2)) = r.DecodeString() + } } if yymg1 { yymv1 = yyv1[yymk1] } - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemValue() + yymdn1 = false if r.TryDecodeAsNil() { - yymv1 = 0 + yymdn1 = true } else { - yyv3 := &yymv1 - yyv3.CodecDecodeSelf(d) - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv4 := &yymk1 + yyv4 := &yymv1 yyv4.CodecDecodeSelf(d) } - if yymg1 { - yymv1 = yyv1[yymk1] - } - z.DecSendContainerState(codecSelfer_containerMapValue1234) - if r.TryDecodeAsNil() { - yymv1 = 0 - } else { - yyv5 := &yymv1 - yyv5.CodecDecodeSelf(d) - } - - if yyv1 != nil { + if yymdn1 { + if yybh1.DeleteOnNilMapValue { + delete(yyv1, yymk1) + } else { + yyv1[yymk1] = 0 + } + } else if yyv1 != nil { yyv1[yymk1] = yymv1 } } } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } diff --git a/pkg/api/v1alpha1/types.generated.go b/pkg/api/v1alpha1/types.generated.go index c3d102d85..b8c8a7b9e 100644 --- a/pkg/api/v1alpha1/types.generated.go +++ b/pkg/api/v1alpha1/types.generated.go @@ -14,10 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ +// Code generated by codecgen - DO NOT EDIT. package v1alpha1 @@ -25,44 +22,42 @@ import ( "errors" "fmt" codec1978 "github.com/ugorji/go/codec" + pkg2_v1 "k8s.io/api/core/v1" pkg1_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkg2_v1 "k8s.io/kubernetes/pkg/api/v1" "reflect" "runtime" ) const ( // ----- content types ---- - codecSelferC_UTF81234 = 1 - codecSelferC_RAW1234 = 0 + codecSelferCcUTF81234 = 1 + codecSelferCcRAW1234 = 0 // ----- value types used ---- - codecSelferValueTypeArray1234 = 10 - codecSelferValueTypeMap1234 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey1234 = 2 - codecSelfer_containerMapValue1234 = 3 - codecSelfer_containerMapEnd1234 = 4 - codecSelfer_containerArrayElem1234 = 6 - codecSelfer_containerArrayEnd1234 = 7 + codecSelferValueTypeArray1234 = 10 + codecSelferValueTypeMap1234 = 9 + codecSelferValueTypeString1234 = 6 + codecSelferValueTypeInt1234 = 2 + codecSelferValueTypeUint1234 = 3 + codecSelferValueTypeFloat1234 = 4 ) var ( codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`) + errCodecSelferOnlyMapOrArrayEncodeToStruct1234 = errors.New(`only encoded map or array can be decoded into a struct`) ) type codecSelfer1234 struct{} func init() { - if codec1978.GenVersion != 5 { + if codec1978.GenVersion != 8 { _, file, _, _ := runtime.Caller(0) err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) + 8, codec1978.GenVersion, file) panic(err) } if false { // reference the types, but skip this branch at build/run time - var v0 pkg1_v1.TypeMeta - var v1 pkg2_v1.ResourceName + var v0 pkg2_v1.ResourceName + var v1 pkg1_v1.TypeMeta _, _ = v0, v1 } } @@ -77,81 +72,82 @@ func (x *DeschedulerPolicy) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 + _ = yyq2 + _, _ = yysep2, yy2arr2 const yyr2 bool = false yyq2[0] = x.Kind != "" yyq2[1] = x.APIVersion != "" yyq2[2] = len(x.Strategies) != 0 - var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) + r.WriteArrayStart(3) } else { - yynn2 = 0 + var yynn2 = 0 for _, b := range yyq2 { if b { yynn2++ } } - r.EncodeMapStart(yynn2) + r.WriteMapStart(yynn2) yynn2 = 0 } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[0] { yym4 := z.EncBinary() _ = yym4 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + r.EncodeString(codecSelferCcUTF81234, string(x.Kind)) } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferCcUTF81234, "") } } else { if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `kind`) + r.WriteMapElemValue() yym5 := z.EncBinary() _ = yym5 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + r.EncodeString(codecSelferCcUTF81234, string(x.Kind)) } } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[1] { yym7 := z.EncBinary() _ = yym7 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferCcUTF81234, string(x.APIVersion)) } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferCcUTF81234, "") } } else { if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `apiVersion`) + r.WriteMapElemValue() yym8 := z.EncBinary() _ = yym8 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferCcUTF81234, string(x.APIVersion)) } } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[2] { if x.Strategies == nil { r.EncodeNil() @@ -163,9 +159,9 @@ func (x *DeschedulerPolicy) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq2[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("strategies")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `strategies`) + r.WriteMapElemValue() if x.Strategies == nil { r.EncodeNil() } else { @@ -174,9 +170,9 @@ func (x *DeschedulerPolicy) CodecEncodeSelf(e *codec1978.Encoder) { } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + r.WriteArrayEnd() } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } } } @@ -189,25 +185,26 @@ func (x *DeschedulerPolicy) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { yyct2 := r.ContainerType() if yyct2 == codecSelferValueTypeMap1234 { yyl2 := r.ReadMapStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } else { x.codecDecodeSelfFromMap(yyl2, d) } } else if yyct2 == codecSelferValueTypeArray1234 { yyl2 := r.ReadArrayStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } else { x.codecDecodeSelfFromArray(yyl2, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct1234) } } } @@ -216,8 +213,6 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc var yyhl3 bool = l >= 0 for yyj3 := 0; ; yyj3++ { if yyhl3 { @@ -229,10 +224,9 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) break } } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemKey() + yys3 := z.StringView(r.DecStructFieldKey(codecSelferValueTypeString1234, z.DecScratchArrayBuffer())) + r.ReadMapElemValue() switch yys3 { case "kind": if r.TryDecodeAsNil() { @@ -269,7 +263,7 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x *DeschedulerPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { @@ -286,10 +280,10 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -308,10 +302,10 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.APIVersion = "" } else { @@ -330,10 +324,10 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Strategies = nil } else { @@ -350,10 +344,10 @@ func (x *DeschedulerPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder if yyb9 { break } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() z.DecStructFieldNotFound(yyj9-1, "") } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } func (x StrategyName) CodecEncodeSelf(e *codec1978.Encoder) { @@ -363,9 +357,10 @@ func (x StrategyName) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) + r.EncodeString(codecSelferCcUTF81234, string(x)) } } @@ -376,7 +371,8 @@ func (x *StrategyName) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { *((*string)(x)) = r.DecodeString() } @@ -392,7 +388,8 @@ func (x StrategyList) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { h.encStrategyList((StrategyList)(x), e) } @@ -406,7 +403,8 @@ func (x *StrategyList) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { h.decStrategyList((*StrategyList)(x), d) } @@ -422,31 +420,32 @@ func (x *DeschedulerStrategy) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 + _ = yyq2 + _, _ = yysep2, yy2arr2 const yyr2 bool = false yyq2[0] = x.Enabled != false yyq2[1] = x.Weight != 0 yyq2[2] = true - var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) + r.WriteArrayStart(3) } else { - yynn2 = 0 + var yynn2 = 0 for _, b := range yyq2 { if b { yynn2++ } } - r.EncodeMapStart(yynn2) + r.WriteMapStart(yynn2) yynn2 = 0 } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[0] { yym4 := z.EncBinary() _ = yym4 @@ -459,9 +458,9 @@ func (x *DeschedulerStrategy) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("enabled")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `enabled`) + r.WriteMapElemValue() yym5 := z.EncBinary() _ = yym5 if false { @@ -471,7 +470,7 @@ func (x *DeschedulerStrategy) CodecEncodeSelf(e *codec1978.Encoder) { } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[1] { yym7 := z.EncBinary() _ = yym7 @@ -484,9 +483,9 @@ func (x *DeschedulerStrategy) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("weight")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `weight`) + r.WriteMapElemValue() yym8 := z.EncBinary() _ = yym8 if false { @@ -496,7 +495,7 @@ func (x *DeschedulerStrategy) CodecEncodeSelf(e *codec1978.Encoder) { } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[2] { yy10 := &x.Params yy10.CodecEncodeSelf(e) @@ -505,17 +504,17 @@ func (x *DeschedulerStrategy) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq2[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("params")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `params`) + r.WriteMapElemValue() yy12 := &x.Params yy12.CodecEncodeSelf(e) } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + r.WriteArrayEnd() } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } } } @@ -528,25 +527,26 @@ func (x *DeschedulerStrategy) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { yyct2 := r.ContainerType() if yyct2 == codecSelferValueTypeMap1234 { yyl2 := r.ReadMapStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } else { x.codecDecodeSelfFromMap(yyl2, d) } } else if yyct2 == codecSelferValueTypeArray1234 { yyl2 := r.ReadArrayStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } else { x.codecDecodeSelfFromArray(yyl2, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct1234) } } } @@ -555,8 +555,6 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc var yyhl3 bool = l >= 0 for yyj3 := 0; ; yyj3++ { if yyhl3 { @@ -568,10 +566,9 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder break } } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemKey() + yys3 := z.StringView(r.DecStructFieldKey(codecSelferValueTypeString1234, z.DecScratchArrayBuffer())) + r.ReadMapElemValue() switch yys3 { case "enabled": if r.TryDecodeAsNil() { @@ -608,7 +605,7 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x *DeschedulerStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { @@ -625,10 +622,10 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decod yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Enabled = false } else { @@ -647,10 +644,10 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decod yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Weight = 0 } else { @@ -669,10 +666,10 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decod yyb9 = r.CheckBreak() } if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Params = StrategyParameters{} } else { @@ -689,10 +686,10 @@ func (x *DeschedulerStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decod if yyb9 { break } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() z.DecStructFieldNotFound(yyj9-1, "") } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } func (x *StrategyParameters) CodecEncodeSelf(e *codec1978.Encoder) { @@ -705,29 +702,30 @@ func (x *StrategyParameters) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 + _ = yyq2 + _, _ = yysep2, yy2arr2 const yyr2 bool = false yyq2[0] = true - var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) + r.WriteArrayStart(1) } else { - yynn2 = 0 + var yynn2 = 0 for _, b := range yyq2 { if b { yynn2++ } } - r.EncodeMapStart(yynn2) + r.WriteMapStart(yynn2) yynn2 = 0 } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[0] { yy4 := &x.NodeResourceUtilizationThresholds yy4.CodecEncodeSelf(e) @@ -736,17 +734,17 @@ func (x *StrategyParameters) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("nodeResourceUtilizationThresholds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `nodeResourceUtilizationThresholds`) + r.WriteMapElemValue() yy6 := &x.NodeResourceUtilizationThresholds yy6.CodecEncodeSelf(e) } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + r.WriteArrayEnd() } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } } } @@ -759,25 +757,26 @@ func (x *StrategyParameters) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { yyct2 := r.ContainerType() if yyct2 == codecSelferValueTypeMap1234 { yyl2 := r.ReadMapStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } else { x.codecDecodeSelfFromMap(yyl2, d) } } else if yyct2 == codecSelferValueTypeArray1234 { yyl2 := r.ReadArrayStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } else { x.codecDecodeSelfFromArray(yyl2, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct1234) } } } @@ -786,8 +785,6 @@ func (x *StrategyParameters) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc var yyhl3 bool = l >= 0 for yyj3 := 0; ; yyj3++ { if yyhl3 { @@ -799,10 +796,9 @@ func (x *StrategyParameters) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) break } } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemKey() + yys3 := z.StringView(r.DecStructFieldKey(codecSelferValueTypeString1234, z.DecScratchArrayBuffer())) + r.ReadMapElemValue() switch yys3 { case "nodeResourceUtilizationThresholds": if r.TryDecodeAsNil() { @@ -815,7 +811,7 @@ func (x *StrategyParameters) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x *StrategyParameters) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { @@ -832,10 +828,10 @@ func (x *StrategyParameters) codecDecodeSelfFromArray(l int, d *codec1978.Decode yyb5 = r.CheckBreak() } if yyb5 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.NodeResourceUtilizationThresholds = NodeResourceUtilizationThresholds{} } else { @@ -852,10 +848,10 @@ func (x *StrategyParameters) codecDecodeSelfFromArray(l int, d *codec1978.Decode if yyb5 { break } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } func (x Percentage) CodecEncodeSelf(e *codec1978.Encoder) { @@ -865,7 +861,8 @@ func (x Percentage) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { r.EncodeFloat64(float64(x)) } @@ -878,9 +875,10 @@ func (x *Percentage) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { - *((*float64)(x)) = float64(r.DecodeFloat(false)) + *((*float64)(x)) = r.DecodeFloat64() } } @@ -894,7 +892,8 @@ func (x ResourceThresholds) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { h.encResourceThresholds((ResourceThresholds)(x), e) } @@ -908,7 +907,8 @@ func (x *ResourceThresholds) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { h.decResourceThresholds((*ResourceThresholds)(x), d) } @@ -924,31 +924,32 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 + _ = yyq2 + _, _ = yysep2, yy2arr2 const yyr2 bool = false yyq2[0] = len(x.Thresholds) != 0 yyq2[1] = len(x.TargetThresholds) != 0 yyq2[2] = x.NumberOfNodes != 0 - var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) + r.WriteArrayStart(3) } else { - yynn2 = 0 + var yynn2 = 0 for _, b := range yyq2 { if b { yynn2++ } } - r.EncodeMapStart(yynn2) + r.WriteMapStart(yynn2) yynn2 = 0 } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[0] { if x.Thresholds == nil { r.EncodeNil() @@ -960,9 +961,9 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder } } else { if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("thresholds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `thresholds`) + r.WriteMapElemValue() if x.Thresholds == nil { r.EncodeNil() } else { @@ -971,7 +972,7 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[1] { if x.TargetThresholds == nil { r.EncodeNil() @@ -983,9 +984,9 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder } } else { if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("targetThresholds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `targetThresholds`) + r.WriteMapElemValue() if x.TargetThresholds == nil { r.EncodeNil() } else { @@ -994,7 +995,7 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[2] { yym10 := z.EncBinary() _ = yym10 @@ -1007,9 +1008,9 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder } } else { if yyq2[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("numberOfNodes")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `numberOfNodes`) + r.WriteMapElemValue() yym11 := z.EncBinary() _ = yym11 if false { @@ -1019,9 +1020,9 @@ func (x *NodeResourceUtilizationThresholds) CodecEncodeSelf(e *codec1978.Encoder } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + r.WriteArrayEnd() } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } } } @@ -1034,25 +1035,26 @@ func (x *NodeResourceUtilizationThresholds) CodecDecodeSelf(d *codec1978.Decoder yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { yyct2 := r.ContainerType() if yyct2 == codecSelferValueTypeMap1234 { yyl2 := r.ReadMapStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } else { x.codecDecodeSelfFromMap(yyl2, d) } } else if yyct2 == codecSelferValueTypeArray1234 { yyl2 := r.ReadArrayStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } else { x.codecDecodeSelfFromArray(yyl2, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct1234) } } } @@ -1061,8 +1063,6 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromMap(l int, d *cod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc var yyhl3 bool = l >= 0 for yyj3 := 0; ; yyj3++ { if yyhl3 { @@ -1074,10 +1074,9 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromMap(l int, d *cod break } } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemKey() + yys3 := z.StringView(r.DecStructFieldKey(codecSelferValueTypeString1234, z.DecScratchArrayBuffer())) + r.ReadMapElemValue() switch yys3 { case "thresholds": if r.TryDecodeAsNil() { @@ -1109,7 +1108,7 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromMap(l int, d *cod z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { @@ -1126,10 +1125,10 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromArray(l int, d *c yyb8 = r.CheckBreak() } if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Thresholds = nil } else { @@ -1143,10 +1142,10 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromArray(l int, d *c yyb8 = r.CheckBreak() } if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.TargetThresholds = nil } else { @@ -1160,10 +1159,10 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromArray(l int, d *c yyb8 = r.CheckBreak() } if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.NumberOfNodes = 0 } else { @@ -1185,25 +1184,25 @@ func (x *NodeResourceUtilizationThresholds) codecDecodeSelfFromArray(l int, d *c if yyb8 { break } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() z.DecStructFieldNotFound(yyj8-1, "") } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } func (x codecSelfer1234) encStrategyList(v StrategyList, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.EncodeMapStart(len(v)) + r.WriteMapStart(len(v)) for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.WriteMapElemKey() yyk1.CodecEncodeSelf(e) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemValue() yy3 := &yyv1 yy3.CodecEncodeSelf(e) } - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } func (x codecSelfer1234) decStrategyList(v *StrategyList, d *codec1978.Decoder) { @@ -1215,19 +1214,20 @@ func (x codecSelfer1234) decStrategyList(v *StrategyList, d *codec1978.Decoder) yyl1 := r.ReadMapStart() yybh1 := z.DecBasicHandle() if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 56) + yyrl1 := z.DecInferLen(yyl1, yybh1.MaxInitLen, 56) yyv1 = make(map[StrategyName]DeschedulerStrategy, yyrl1) *v = yyv1 } var yymk1 StrategyName var yymv1 DeschedulerStrategy - var yymg1 bool + var yymg1, yymdn1 bool if yybh1.MapValueReset { yymg1 = true } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) + if yyl1 != 0 { + yyhl1 := yyl1 > 0 + for yyj1 := 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { + r.ReadMapElemKey() if r.TryDecodeAsNil() { yymk1 = "" } else { @@ -1240,62 +1240,48 @@ func (x codecSelfer1234) decStrategyList(v *StrategyList, d *codec1978.Decoder) } else { yymv1 = DeschedulerStrategy{} } - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemValue() + yymdn1 = false if r.TryDecodeAsNil() { - yymv1 = DeschedulerStrategy{} + yymdn1 = true } else { yyv3 := &yymv1 yyv3.CodecDecodeSelf(d) } - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv4 := &yymk1 - yyv4.CodecDecodeSelf(d) - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } else { - yymv1 = DeschedulerStrategy{} - } - z.DecSendContainerState(codecSelfer_containerMapValue1234) - if r.TryDecodeAsNil() { - yymv1 = DeschedulerStrategy{} - } else { - yyv5 := &yymv1 - yyv5.CodecDecodeSelf(d) - } - - if yyv1 != nil { + if yymdn1 { + if yybh1.DeleteOnNilMapValue { + delete(yyv1, yymk1) + } else { + yyv1[yymk1] = DeschedulerStrategy{} + } + } else if yyv1 != nil { yyv1[yymk1] = yymv1 } } } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x codecSelfer1234) encResourceThresholds(v ResourceThresholds, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.EncodeMapStart(len(v)) + r.WriteMapStart(len(v)) for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - yysf2 := &yyk1 - yysf2.CodecEncodeSelf(e) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + yym2 := z.EncBinary() + _ = yym2 + if false { + } else if yyxt2 := z.Extension(z.I2Rtid(yyk1)); yyxt2 != nil { + z.EncExtension(yyk1, yyxt2) + } else { + r.EncodeString(codecSelferCcUTF81234, string(yyk1)) + } + r.WriteMapElemValue() yyv1.CodecEncodeSelf(e) } - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } func (x codecSelfer1234) decResourceThresholds(v *ResourceThresholds, d *codec1978.Decoder) { @@ -1307,65 +1293,55 @@ func (x codecSelfer1234) decResourceThresholds(v *ResourceThresholds, d *codec19 yyl1 := r.ReadMapStart() yybh1 := z.DecBasicHandle() if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 24) + yyrl1 := z.DecInferLen(yyl1, yybh1.MaxInitLen, 24) yyv1 = make(map[pkg2_v1.ResourceName]Percentage, yyrl1) *v = yyv1 } var yymk1 pkg2_v1.ResourceName var yymv1 Percentage - var yymg1 bool + var yymg1, yymdn1 bool if yybh1.MapValueReset { } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) + if yyl1 != 0 { + yyhl1 := yyl1 > 0 + for yyj1 := 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { + r.ReadMapElemKey() if r.TryDecodeAsNil() { yymk1 = "" } else { yyv2 := &yymk1 - yyv2.CodecDecodeSelf(d) + yym3 := z.DecBinary() + _ = yym3 + if false { + } else if yyxt3 := z.Extension(z.I2Rtid(yyv2)); yyxt3 != nil { + z.DecExtension(yyv2, yyxt3) + } else { + *((*string)(yyv2)) = r.DecodeString() + } } if yymg1 { yymv1 = yyv1[yymk1] } - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemValue() + yymdn1 = false if r.TryDecodeAsNil() { - yymv1 = 0 + yymdn1 = true } else { - yyv3 := &yymv1 - yyv3.CodecDecodeSelf(d) - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv4 := &yymk1 + yyv4 := &yymv1 yyv4.CodecDecodeSelf(d) } - if yymg1 { - yymv1 = yyv1[yymk1] - } - z.DecSendContainerState(codecSelfer_containerMapValue1234) - if r.TryDecodeAsNil() { - yymv1 = 0 - } else { - yyv5 := &yymv1 - yyv5.CodecDecodeSelf(d) - } - - if yyv1 != nil { + if yymdn1 { + if yybh1.DeleteOnNilMapValue { + delete(yyv1, yymk1) + } else { + yyv1[yymk1] = 0 + } + } else if yyv1 != nil { yyv1[yymk1] = yymv1 } } } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } diff --git a/pkg/api/v1alpha1/zz_generated.conversion.go b/pkg/api/v1alpha1/zz_generated.conversion.go index b5b1d4ca6..f74d4f47e 100644 --- a/pkg/api/v1alpha1/zz_generated.conversion.go +++ b/pkg/api/v1alpha1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,14 +21,15 @@ limitations under the License. package v1alpha1 import ( + unsafe "unsafe" + api "github.com/kubernetes-incubator/descheduler/pkg/api" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - unsafe "unsafe" ) func init() { - SchemeBuilder.Register(RegisterConversions) + localSchemeBuilder.Register(RegisterConversions) } // RegisterConversions adds conversion functions to the given scheme. diff --git a/pkg/api/v1alpha1/zz_generated.deepcopy.go b/pkg/api/v1alpha1/zz_generated.deepcopy.go index de443fad9..0caa6c800 100644 --- a/pkg/api/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/api/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,93 +21,104 @@ limitations under the License. package v1alpha1 import ( - conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - reflect "reflect" ) -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_DeschedulerPolicy, InType: reflect.TypeOf(&DeschedulerPolicy{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_DeschedulerStrategy, InType: reflect.TypeOf(&DeschedulerStrategy{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_NodeResourceUtilizationThresholds, InType: reflect.TypeOf(&NodeResourceUtilizationThresholds{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_StrategyParameters, InType: reflect.TypeOf(&StrategyParameters{})}, - ) -} - -// DeepCopy_v1alpha1_DeschedulerPolicy is an autogenerated deepcopy function. -func DeepCopy_v1alpha1_DeschedulerPolicy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeschedulerPolicy) - out := out.(*DeschedulerPolicy) - *out = *in - if in.Strategies != nil { - in, out := &in.Strategies, &out.Strategies - *out = make(StrategyList) - for key, val := range *in { - newVal := new(DeschedulerStrategy) - if err := DeepCopy_v1alpha1_DeschedulerStrategy(&val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal - } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeschedulerPolicy) DeepCopyInto(out *DeschedulerPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.Strategies != nil { + in, out := &in.Strategies, &out.Strategies + *out = make(StrategyList, len(*in)) + for key, val := range *in { + newVal := new(DeschedulerStrategy) + val.DeepCopyInto(newVal) + (*out)[key] = *newVal } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeschedulerPolicy. +func (in *DeschedulerPolicy) DeepCopy() *DeschedulerPolicy { + if in == nil { + return nil + } + out := new(DeschedulerPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeschedulerPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { return nil } } -// DeepCopy_v1alpha1_DeschedulerStrategy is an autogenerated deepcopy function. -func DeepCopy_v1alpha1_DeschedulerStrategy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeschedulerStrategy) - out := out.(*DeschedulerStrategy) - *out = *in - if err := DeepCopy_v1alpha1_StrategyParameters(&in.Params, &out.Params, c); err != nil { - return err - } - return nil - } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeschedulerStrategy) DeepCopyInto(out *DeschedulerStrategy) { + *out = *in + in.Params.DeepCopyInto(&out.Params) + return } -// DeepCopy_v1alpha1_NodeResourceUtilizationThresholds is an autogenerated deepcopy function. -func DeepCopy_v1alpha1_NodeResourceUtilizationThresholds(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeResourceUtilizationThresholds) - out := out.(*NodeResourceUtilizationThresholds) - *out = *in - if in.Thresholds != nil { - in, out := &in.Thresholds, &out.Thresholds - *out = make(ResourceThresholds) - for key, val := range *in { - (*out)[key] = val - } - } - if in.TargetThresholds != nil { - in, out := &in.TargetThresholds, &out.TargetThresholds - *out = make(ResourceThresholds) - for key, val := range *in { - (*out)[key] = val - } - } +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeschedulerStrategy. +func (in *DeschedulerStrategy) DeepCopy() *DeschedulerStrategy { + if in == nil { return nil } + out := new(DeschedulerStrategy) + in.DeepCopyInto(out) + return out } -// DeepCopy_v1alpha1_StrategyParameters is an autogenerated deepcopy function. -func DeepCopy_v1alpha1_StrategyParameters(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*StrategyParameters) - out := out.(*StrategyParameters) - *out = *in - if err := DeepCopy_v1alpha1_NodeResourceUtilizationThresholds(&in.NodeResourceUtilizationThresholds, &out.NodeResourceUtilizationThresholds, c); err != nil { - return err +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeResourceUtilizationThresholds) DeepCopyInto(out *NodeResourceUtilizationThresholds) { + *out = *in + if in.Thresholds != nil { + in, out := &in.Thresholds, &out.Thresholds + *out = make(ResourceThresholds, len(*in)) + for key, val := range *in { + (*out)[key] = val } + } + if in.TargetThresholds != nil { + in, out := &in.TargetThresholds, &out.TargetThresholds + *out = make(ResourceThresholds, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeResourceUtilizationThresholds. +func (in *NodeResourceUtilizationThresholds) DeepCopy() *NodeResourceUtilizationThresholds { + if in == nil { return nil } + out := new(NodeResourceUtilizationThresholds) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StrategyParameters) DeepCopyInto(out *StrategyParameters) { + *out = *in + in.NodeResourceUtilizationThresholds.DeepCopyInto(&out.NodeResourceUtilizationThresholds) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategyParameters. +func (in *StrategyParameters) DeepCopy() *StrategyParameters { + if in == nil { + return nil + } + out := new(StrategyParameters) + in.DeepCopyInto(out) + return out } diff --git a/pkg/api/v1alpha1/zz_generated.defaults.go b/pkg/api/v1alpha1/zz_generated.defaults.go index 7e6df29d4..5e24d22ca 100644 --- a/pkg/api/v1alpha1/zz_generated.defaults.go +++ b/pkg/api/v1alpha1/zz_generated.defaults.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/api/zz_generated.deepcopy.go b/pkg/api/zz_generated.deepcopy.go index acf40f7fb..ed322f86a 100644 --- a/pkg/api/zz_generated.deepcopy.go +++ b/pkg/api/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,93 +21,104 @@ limitations under the License. package api import ( - conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - reflect "reflect" ) -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_DeschedulerPolicy, InType: reflect.TypeOf(&DeschedulerPolicy{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_DeschedulerStrategy, InType: reflect.TypeOf(&DeschedulerStrategy{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeResourceUtilizationThresholds, InType: reflect.TypeOf(&NodeResourceUtilizationThresholds{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_StrategyParameters, InType: reflect.TypeOf(&StrategyParameters{})}, - ) -} - -// DeepCopy_api_DeschedulerPolicy is an autogenerated deepcopy function. -func DeepCopy_api_DeschedulerPolicy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeschedulerPolicy) - out := out.(*DeschedulerPolicy) - *out = *in - if in.Strategies != nil { - in, out := &in.Strategies, &out.Strategies - *out = make(StrategyList) - for key, val := range *in { - newVal := new(DeschedulerStrategy) - if err := DeepCopy_api_DeschedulerStrategy(&val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal - } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeschedulerPolicy) DeepCopyInto(out *DeschedulerPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.Strategies != nil { + in, out := &in.Strategies, &out.Strategies + *out = make(StrategyList, len(*in)) + for key, val := range *in { + newVal := new(DeschedulerStrategy) + val.DeepCopyInto(newVal) + (*out)[key] = *newVal } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeschedulerPolicy. +func (in *DeschedulerPolicy) DeepCopy() *DeschedulerPolicy { + if in == nil { + return nil + } + out := new(DeschedulerPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeschedulerPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { return nil } } -// DeepCopy_api_DeschedulerStrategy is an autogenerated deepcopy function. -func DeepCopy_api_DeschedulerStrategy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeschedulerStrategy) - out := out.(*DeschedulerStrategy) - *out = *in - if err := DeepCopy_api_StrategyParameters(&in.Params, &out.Params, c); err != nil { - return err - } - return nil - } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeschedulerStrategy) DeepCopyInto(out *DeschedulerStrategy) { + *out = *in + in.Params.DeepCopyInto(&out.Params) + return } -// DeepCopy_api_NodeResourceUtilizationThresholds is an autogenerated deepcopy function. -func DeepCopy_api_NodeResourceUtilizationThresholds(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeResourceUtilizationThresholds) - out := out.(*NodeResourceUtilizationThresholds) - *out = *in - if in.Thresholds != nil { - in, out := &in.Thresholds, &out.Thresholds - *out = make(ResourceThresholds) - for key, val := range *in { - (*out)[key] = val - } - } - if in.TargetThresholds != nil { - in, out := &in.TargetThresholds, &out.TargetThresholds - *out = make(ResourceThresholds) - for key, val := range *in { - (*out)[key] = val - } - } +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeschedulerStrategy. +func (in *DeschedulerStrategy) DeepCopy() *DeschedulerStrategy { + if in == nil { return nil } + out := new(DeschedulerStrategy) + in.DeepCopyInto(out) + return out } -// DeepCopy_api_StrategyParameters is an autogenerated deepcopy function. -func DeepCopy_api_StrategyParameters(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*StrategyParameters) - out := out.(*StrategyParameters) - *out = *in - if err := DeepCopy_api_NodeResourceUtilizationThresholds(&in.NodeResourceUtilizationThresholds, &out.NodeResourceUtilizationThresholds, c); err != nil { - return err +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeResourceUtilizationThresholds) DeepCopyInto(out *NodeResourceUtilizationThresholds) { + *out = *in + if in.Thresholds != nil { + in, out := &in.Thresholds, &out.Thresholds + *out = make(ResourceThresholds, len(*in)) + for key, val := range *in { + (*out)[key] = val } + } + if in.TargetThresholds != nil { + in, out := &in.TargetThresholds, &out.TargetThresholds + *out = make(ResourceThresholds, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeResourceUtilizationThresholds. +func (in *NodeResourceUtilizationThresholds) DeepCopy() *NodeResourceUtilizationThresholds { + if in == nil { return nil } + out := new(NodeResourceUtilizationThresholds) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StrategyParameters) DeepCopyInto(out *StrategyParameters) { + *out = *in + in.NodeResourceUtilizationThresholds.DeepCopyInto(&out.NodeResourceUtilizationThresholds) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategyParameters. +func (in *StrategyParameters) DeepCopy() *StrategyParameters { + if in == nil { + return nil + } + out := new(StrategyParameters) + in.DeepCopyInto(out) + return out } diff --git a/pkg/apis/componentconfig/types.generated.go b/pkg/apis/componentconfig/types.generated.go index e8dac52bf..593a92558 100644 --- a/pkg/apis/componentconfig/types.generated.go +++ b/pkg/apis/componentconfig/types.generated.go @@ -14,10 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ +// Code generated by codecgen - DO NOT EDIT. package componentconfig @@ -33,31 +30,29 @@ import ( const ( // ----- content types ---- - codecSelferC_UTF81234 = 1 - codecSelferC_RAW1234 = 0 + codecSelferCcUTF81234 = 1 + codecSelferCcRAW1234 = 0 // ----- value types used ---- - codecSelferValueTypeArray1234 = 10 - codecSelferValueTypeMap1234 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey1234 = 2 - codecSelfer_containerMapValue1234 = 3 - codecSelfer_containerMapEnd1234 = 4 - codecSelfer_containerArrayElem1234 = 6 - codecSelfer_containerArrayEnd1234 = 7 + codecSelferValueTypeArray1234 = 10 + codecSelferValueTypeMap1234 = 9 + codecSelferValueTypeString1234 = 6 + codecSelferValueTypeInt1234 = 2 + codecSelferValueTypeUint1234 = 3 + codecSelferValueTypeFloat1234 = 4 ) var ( codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`) + errCodecSelferOnlyMapOrArrayEncodeToStruct1234 = errors.New(`only encoded map or array can be decoded into a struct`) ) type codecSelfer1234 struct{} func init() { - if codec1978.GenVersion != 5 { + if codec1978.GenVersion != 8 { _, file, _, _ := runtime.Caller(0) err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) + 8, codec1978.GenVersion, file) panic(err) } if false { // reference the types, but skip this branch at build/run time @@ -77,139 +72,142 @@ func (x *DeschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray var yyq2 [7]bool - _, _, _ = yysep2, yyq2, yy2arr2 + _ = yyq2 + _, _ = yysep2, yy2arr2 const yyr2 bool = false yyq2[0] = x.Kind != "" yyq2[1] = x.APIVersion != "" - var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(7) + r.WriteArrayStart(7) } else { - yynn2 = 5 + var yynn2 = 5 for _, b := range yyq2 { if b { yynn2++ } } - r.EncodeMapStart(yynn2) + r.WriteMapStart(yynn2) yynn2 = 0 } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[0] { yym4 := z.EncBinary() _ = yym4 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + r.EncodeString(codecSelferCcUTF81234, string(x.Kind)) } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferCcUTF81234, "") } } else { if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `kind`) + r.WriteMapElemValue() yym5 := z.EncBinary() _ = yym5 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + r.EncodeString(codecSelferCcUTF81234, string(x.Kind)) } } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[1] { yym7 := z.EncBinary() _ = yym7 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferCcUTF81234, string(x.APIVersion)) } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferCcUTF81234, "") } } else { if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `apiVersion`) + r.WriteMapElemValue() yym8 := z.EncBinary() _ = yym8 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferCcUTF81234, string(x.APIVersion)) } } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() yym10 := z.EncBinary() _ = yym10 if false { - } else if z.HasExtensions() && z.EncExt(x.DeschedulingInterval) { + } else if yyxt10 := z.Extension(z.I2Rtid(x.DeschedulingInterval)); yyxt10 != nil { + z.EncExtension(x.DeschedulingInterval, yyxt10) } else { r.EncodeInt(int64(x.DeschedulingInterval)) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("DeschedulingInterval")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `DeschedulingInterval`) + r.WriteMapElemValue() yym11 := z.EncBinary() _ = yym11 if false { - } else if z.HasExtensions() && z.EncExt(x.DeschedulingInterval) { + } else if yyxt11 := z.Extension(z.I2Rtid(x.DeschedulingInterval)); yyxt11 != nil { + z.EncExtension(x.DeschedulingInterval, yyxt11) } else { r.EncodeInt(int64(x.DeschedulingInterval)) } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() yym13 := z.EncBinary() _ = yym13 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.KubeconfigFile)) + r.EncodeString(codecSelferCcUTF81234, string(x.KubeconfigFile)) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("KubeconfigFile")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `KubeconfigFile`) + r.WriteMapElemValue() yym14 := z.EncBinary() _ = yym14 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.KubeconfigFile)) + r.EncodeString(codecSelferCcUTF81234, string(x.KubeconfigFile)) } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() yym16 := z.EncBinary() _ = yym16 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.PolicyConfigFile)) + r.EncodeString(codecSelferCcUTF81234, string(x.PolicyConfigFile)) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("PolicyConfigFile")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `PolicyConfigFile`) + r.WriteMapElemValue() yym17 := z.EncBinary() _ = yym17 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.PolicyConfigFile)) + r.EncodeString(codecSelferCcUTF81234, string(x.PolicyConfigFile)) } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() yym19 := z.EncBinary() _ = yym19 if false { @@ -217,9 +215,9 @@ func (x *DeschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(bool(x.DryRun)) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("DryRun")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `DryRun`) + r.WriteMapElemValue() yym20 := z.EncBinary() _ = yym20 if false { @@ -228,28 +226,28 @@ func (x *DeschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() yym22 := z.EncBinary() _ = yym22 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.NodeSelector)) + r.EncodeString(codecSelferCcUTF81234, string(x.NodeSelector)) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("NodeSelector")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `NodeSelector`) + r.WriteMapElemValue() yym23 := z.EncBinary() _ = yym23 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.NodeSelector)) + r.EncodeString(codecSelferCcUTF81234, string(x.NodeSelector)) } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + r.WriteArrayEnd() } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } } } @@ -262,25 +260,26 @@ func (x *DeschedulerConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { yyct2 := r.ContainerType() if yyct2 == codecSelferValueTypeMap1234 { yyl2 := r.ReadMapStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } else { x.codecDecodeSelfFromMap(yyl2, d) } } else if yyct2 == codecSelferValueTypeArray1234 { yyl2 := r.ReadArrayStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } else { x.codecDecodeSelfFromArray(yyl2, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct1234) } } } @@ -289,8 +288,6 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc var yyhl3 bool = l >= 0 for yyj3 := 0; ; yyj3++ { if yyhl3 { @@ -302,10 +299,9 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.De break } } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemKey() + yys3 := z.StringView(r.DecStructFieldKey(codecSelferValueTypeString1234, z.DecScratchArrayBuffer())) + r.ReadMapElemValue() switch yys3 { case "kind": if r.TryDecodeAsNil() { @@ -339,7 +335,8 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.De yym9 := z.DecBinary() _ = yym9 if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { + } else if yyxt9 := z.Extension(z.I2Rtid(yyv8)); yyxt9 != nil { + z.DecExtension(yyv8, yyxt9) } else { *((*int64)(yyv8)) = int64(r.DecodeInt(64)) } @@ -396,7 +393,7 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.De z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { @@ -413,10 +410,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -435,10 +432,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.APIVersion = "" } else { @@ -457,10 +454,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.DeschedulingInterval = 0 } else { @@ -468,7 +465,8 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yym24 := z.DecBinary() _ = yym24 if false { - } else if z.HasExtensions() && z.DecExt(yyv23) { + } else if yyxt24 := z.Extension(z.I2Rtid(yyv23)); yyxt24 != nil { + z.DecExtension(yyv23, yyxt24) } else { *((*int64)(yyv23)) = int64(r.DecodeInt(64)) } @@ -480,10 +478,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.KubeconfigFile = "" } else { @@ -502,10 +500,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.PolicyConfigFile = "" } else { @@ -524,10 +522,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.DryRun = false } else { @@ -546,10 +544,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.NodeSelector = "" } else { @@ -571,8 +569,8 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. if yyb18 { break } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() z.DecStructFieldNotFound(yyj18-1, "") } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } diff --git a/pkg/apis/componentconfig/v1alpha1/types.generated.go b/pkg/apis/componentconfig/v1alpha1/types.generated.go index e2389188e..fc45a8f8d 100644 --- a/pkg/apis/componentconfig/v1alpha1/types.generated.go +++ b/pkg/apis/componentconfig/v1alpha1/types.generated.go @@ -14,10 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ +// Code generated by codecgen - DO NOT EDIT. package v1alpha1 @@ -33,31 +30,29 @@ import ( const ( // ----- content types ---- - codecSelferC_UTF81234 = 1 - codecSelferC_RAW1234 = 0 + codecSelferCcUTF81234 = 1 + codecSelferCcRAW1234 = 0 // ----- value types used ---- - codecSelferValueTypeArray1234 = 10 - codecSelferValueTypeMap1234 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey1234 = 2 - codecSelfer_containerMapValue1234 = 3 - codecSelfer_containerMapEnd1234 = 4 - codecSelfer_containerArrayElem1234 = 6 - codecSelfer_containerArrayEnd1234 = 7 + codecSelferValueTypeArray1234 = 10 + codecSelferValueTypeMap1234 = 9 + codecSelferValueTypeString1234 = 6 + codecSelferValueTypeInt1234 = 2 + codecSelferValueTypeUint1234 = 3 + codecSelferValueTypeFloat1234 = 4 ) var ( codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`) + errCodecSelferOnlyMapOrArrayEncodeToStruct1234 = errors.New(`only encoded map or array can be decoded into a struct`) ) type codecSelfer1234 struct{} func init() { - if codec1978.GenVersion != 5 { + if codec1978.GenVersion != 8 { _, file, _, _ := runtime.Caller(0) err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) + 8, codec1978.GenVersion, file) panic(err) } if false { // reference the types, but skip this branch at build/run time @@ -77,12 +72,14 @@ func (x *DeschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { yym1 := z.EncBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.EncExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray var yyq2 [7]bool - _, _, _ = yysep2, yyq2, yy2arr2 + _ = yyq2 + _, _ = yysep2, yy2arr2 const yyr2 bool = false yyq2[0] = x.Kind != "" yyq2[1] = x.APIVersion != "" @@ -90,76 +87,76 @@ func (x *DeschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { yyq2[4] = x.PolicyConfigFile != "" yyq2[5] = x.DryRun != false yyq2[6] = x.NodeSelector != "" - var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(7) + r.WriteArrayStart(7) } else { - yynn2 = 1 + var yynn2 = 1 for _, b := range yyq2 { if b { yynn2++ } } - r.EncodeMapStart(yynn2) + r.WriteMapStart(yynn2) yynn2 = 0 } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[0] { yym4 := z.EncBinary() _ = yym4 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + r.EncodeString(codecSelferCcUTF81234, string(x.Kind)) } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferCcUTF81234, "") } } else { if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `kind`) + r.WriteMapElemValue() yym5 := z.EncBinary() _ = yym5 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + r.EncodeString(codecSelferCcUTF81234, string(x.Kind)) } } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[1] { yym7 := z.EncBinary() _ = yym7 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferCcUTF81234, string(x.APIVersion)) } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferCcUTF81234, "") } } else { if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `apiVersion`) + r.WriteMapElemValue() yym8 := z.EncBinary() _ = yym8 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferCcUTF81234, string(x.APIVersion)) } } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[2] { yym10 := z.EncBinary() _ = yym10 if false { - } else if z.HasExtensions() && z.EncExt(x.DeschedulingInterval) { + } else if yyxt10 := z.Extension(z.I2Rtid(x.DeschedulingInterval)); yyxt10 != nil { + z.EncExtension(x.DeschedulingInterval, yyxt10) } else { r.EncodeInt(int64(x.DeschedulingInterval)) } @@ -168,64 +165,65 @@ func (x *DeschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq2[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("deschedulingInterval")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `deschedulingInterval`) + r.WriteMapElemValue() yym11 := z.EncBinary() _ = yym11 if false { - } else if z.HasExtensions() && z.EncExt(x.DeschedulingInterval) { + } else if yyxt11 := z.Extension(z.I2Rtid(x.DeschedulingInterval)); yyxt11 != nil { + z.EncExtension(x.DeschedulingInterval, yyxt11) } else { r.EncodeInt(int64(x.DeschedulingInterval)) } } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() yym13 := z.EncBinary() _ = yym13 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.KubeconfigFile)) + r.EncodeString(codecSelferCcUTF81234, string(x.KubeconfigFile)) } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kubeconfigFile")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `kubeconfigFile`) + r.WriteMapElemValue() yym14 := z.EncBinary() _ = yym14 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.KubeconfigFile)) + r.EncodeString(codecSelferCcUTF81234, string(x.KubeconfigFile)) } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[4] { yym16 := z.EncBinary() _ = yym16 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.PolicyConfigFile)) + r.EncodeString(codecSelferCcUTF81234, string(x.PolicyConfigFile)) } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferCcUTF81234, "") } } else { if yyq2[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("policyConfigFile")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `policyConfigFile`) + r.WriteMapElemValue() yym17 := z.EncBinary() _ = yym17 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.PolicyConfigFile)) + r.EncodeString(codecSelferCcUTF81234, string(x.PolicyConfigFile)) } } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[5] { yym19 := z.EncBinary() _ = yym19 @@ -238,9 +236,9 @@ func (x *DeschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq2[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("dryRun")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `dryRun`) + r.WriteMapElemValue() yym20 := z.EncBinary() _ = yym20 if false { @@ -250,34 +248,34 @@ func (x *DeschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) + r.WriteArrayElem() if yyq2[6] { yym22 := z.EncBinary() _ = yym22 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.NodeSelector)) + r.EncodeString(codecSelferCcUTF81234, string(x.NodeSelector)) } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeString(codecSelferCcUTF81234, "") } } else { if yyq2[6] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("nodeSelector")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.WriteMapElemKey() + r.EncStructFieldKey(codecSelferValueTypeString1234, `nodeSelector`) + r.WriteMapElemValue() yym23 := z.EncBinary() _ = yym23 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.NodeSelector)) + r.EncodeString(codecSelferCcUTF81234, string(x.NodeSelector)) } } } if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + r.WriteArrayEnd() } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) + r.WriteMapEnd() } } } @@ -290,25 +288,26 @@ func (x *DeschedulerConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { yym1 := z.DecBinary() _ = yym1 if false { - } else if z.HasExtensions() && z.DecExt(x) { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) } else { yyct2 := r.ContainerType() if yyct2 == codecSelferValueTypeMap1234 { yyl2 := r.ReadMapStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } else { x.codecDecodeSelfFromMap(yyl2, d) } } else if yyct2 == codecSelferValueTypeArray1234 { yyl2 := r.ReadArrayStart() if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } else { x.codecDecodeSelfFromArray(yyl2, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct1234) } } } @@ -317,8 +316,6 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc var yyhl3 bool = l >= 0 for yyj3 := 0; ; yyj3++ { if yyhl3 { @@ -330,10 +327,9 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.De break } } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) + r.ReadMapElemKey() + yys3 := z.StringView(r.DecStructFieldKey(codecSelferValueTypeString1234, z.DecScratchArrayBuffer())) + r.ReadMapElemValue() switch yys3 { case "kind": if r.TryDecodeAsNil() { @@ -367,7 +363,8 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.De yym9 := z.DecBinary() _ = yym9 if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { + } else if yyxt9 := z.Extension(z.I2Rtid(yyv8)); yyxt9 != nil { + z.DecExtension(yyv8, yyxt9) } else { *((*int64)(yyv8)) = int64(r.DecodeInt(64)) } @@ -424,7 +421,7 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.De z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + r.ReadMapEnd() } func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { @@ -441,10 +438,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -463,10 +460,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.APIVersion = "" } else { @@ -485,10 +482,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.DeschedulingInterval = 0 } else { @@ -496,7 +493,8 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yym24 := z.DecBinary() _ = yym24 if false { - } else if z.HasExtensions() && z.DecExt(yyv23) { + } else if yyxt24 := z.Extension(z.I2Rtid(yyv23)); yyxt24 != nil { + z.DecExtension(yyv23, yyxt24) } else { *((*int64)(yyv23)) = int64(r.DecodeInt(64)) } @@ -508,10 +506,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.KubeconfigFile = "" } else { @@ -530,10 +528,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.PolicyConfigFile = "" } else { @@ -552,10 +550,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.DryRun = false } else { @@ -574,10 +572,10 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. yyb18 = r.CheckBreak() } if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() return } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() if r.TryDecodeAsNil() { x.NodeSelector = "" } else { @@ -599,8 +597,8 @@ func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978. if yyb18 { break } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) + r.ReadArrayElem() z.DecStructFieldNotFound(yyj18-1, "") } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + r.ReadArrayEnd() } diff --git a/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go b/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go index 8d3c5915b..403c6c337 100644 --- a/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,14 +21,15 @@ limitations under the License. package v1alpha1 import ( + time "time" + componentconfig "github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - time "time" ) func init() { - SchemeBuilder.Register(RegisterConversions) + localSchemeBuilder.Register(RegisterConversions) } // RegisterConversions adds conversion functions to the given scheme. diff --git a/pkg/apis/componentconfig/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/componentconfig/v1alpha1/zz_generated.deepcopy.go index ed1df21c6..2173d8915 100644 --- a/pkg/apis/componentconfig/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/componentconfig/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,29 +21,31 @@ limitations under the License. package v1alpha1 import ( - conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - reflect "reflect" ) -func init() { - SchemeBuilder.Register(RegisterDeepCopies) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeschedulerConfiguration) DeepCopyInto(out *DeschedulerConfiguration) { + *out = *in + out.TypeMeta = in.TypeMeta + return } -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_DeschedulerConfiguration, InType: reflect.TypeOf(&DeschedulerConfiguration{})}, - ) +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeschedulerConfiguration. +func (in *DeschedulerConfiguration) DeepCopy() *DeschedulerConfiguration { + if in == nil { + return nil + } + out := new(DeschedulerConfiguration) + in.DeepCopyInto(out) + return out } -// DeepCopy_v1alpha1_DeschedulerConfiguration is an autogenerated deepcopy function. -func DeepCopy_v1alpha1_DeschedulerConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeschedulerConfiguration) - out := out.(*DeschedulerConfiguration) - *out = *in +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeschedulerConfiguration) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { return nil } } diff --git a/pkg/apis/componentconfig/v1alpha1/zz_generated.defaults.go b/pkg/apis/componentconfig/v1alpha1/zz_generated.defaults.go index 7e6df29d4..5e24d22ca 100644 --- a/pkg/apis/componentconfig/v1alpha1/zz_generated.defaults.go +++ b/pkg/apis/componentconfig/v1alpha1/zz_generated.defaults.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/apis/componentconfig/zz_generated.deepcopy.go b/pkg/apis/componentconfig/zz_generated.deepcopy.go index 6e59476c0..f129854d0 100644 --- a/pkg/apis/componentconfig/zz_generated.deepcopy.go +++ b/pkg/apis/componentconfig/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,29 +21,31 @@ limitations under the License. package componentconfig import ( - conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - reflect "reflect" ) -func init() { - SchemeBuilder.Register(RegisterDeepCopies) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeschedulerConfiguration) DeepCopyInto(out *DeschedulerConfiguration) { + *out = *in + out.TypeMeta = in.TypeMeta + return } -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_DeschedulerConfiguration, InType: reflect.TypeOf(&DeschedulerConfiguration{})}, - ) +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeschedulerConfiguration. +func (in *DeschedulerConfiguration) DeepCopy() *DeschedulerConfiguration { + if in == nil { + return nil + } + out := new(DeschedulerConfiguration) + in.DeepCopyInto(out) + return out } -// DeepCopy_componentconfig_DeschedulerConfiguration is an autogenerated deepcopy function. -func DeepCopy_componentconfig_DeschedulerConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeschedulerConfiguration) - out := out.(*DeschedulerConfiguration) - *out = *in +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeschedulerConfiguration) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { return nil } }