Generated changes to suspend becoming pointer for ScheduledJob

This commit is contained in:
Maciej Szulik 2016-05-23 23:10:59 +02:00
parent d8b9495ea0
commit e1aa8835d9
6 changed files with 200 additions and 124 deletions

View File

@ -246,7 +246,13 @@ func DeepCopy_batch_ScheduledJobSpec(in ScheduledJobSpec, out *ScheduledJobSpec,
out.StartingDeadlineSeconds = nil out.StartingDeadlineSeconds = nil
} }
out.ConcurrencyPolicy = in.ConcurrencyPolicy out.ConcurrencyPolicy = in.ConcurrencyPolicy
out.Suspend = in.Suspend if in.Suspend != nil {
in, out := in.Suspend, &out.Suspend
*out = new(bool)
**out = *in
} else {
out.Suspend = nil
}
if err := DeepCopy_batch_JobTemplateSpec(in.JobTemplate, &out.JobTemplate, c); err != nil { if err := DeepCopy_batch_JobTemplateSpec(in.JobTemplate, &out.JobTemplate, c); err != nil {
return err return err
} }

View File

@ -3602,33 +3602,43 @@ func (x *ScheduledJobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
} }
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
yym15 := z.EncBinary() if x.Suspend == nil {
_ = yym15 r.EncodeNil()
} else {
yy15 := *x.Suspend
yym16 := z.EncBinary()
_ = yym16
if false { if false {
} else { } else {
r.EncodeBool(bool(x.Suspend)) r.EncodeBool(bool(yy15))
}
} }
} else { } else {
z.EncSendContainerState(codecSelfer_containerMapKey1234) z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("suspend")) r.EncodeString(codecSelferC_UTF81234, string("suspend"))
z.EncSendContainerState(codecSelfer_containerMapValue1234) z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym16 := z.EncBinary() if x.Suspend == nil {
_ = yym16 r.EncodeNil()
} else {
yy17 := *x.Suspend
yym18 := z.EncBinary()
_ = yym18
if false { if false {
} else { } else {
r.EncodeBool(bool(x.Suspend)) r.EncodeBool(bool(yy17))
}
} }
} }
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
yy18 := &x.JobTemplate yy20 := &x.JobTemplate
yy18.CodecEncodeSelf(e) yy20.CodecEncodeSelf(e)
} else { } else {
z.EncSendContainerState(codecSelfer_containerMapKey1234) z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("jobTemplate")) r.EncodeString(codecSelferC_UTF81234, string("jobTemplate"))
z.EncSendContainerState(codecSelfer_containerMapValue1234) z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy20 := &x.JobTemplate yy22 := &x.JobTemplate
yy20.CodecEncodeSelf(e) yy22.CodecEncodeSelf(e)
} }
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234) z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
@ -3721,16 +3731,26 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
} }
case "suspend": case "suspend":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Suspend = false if x.Suspend != nil {
x.Suspend = nil
}
} else { } else {
x.Suspend = bool(r.DecodeBool()) if x.Suspend == nil {
x.Suspend = new(bool)
}
yym9 := z.DecBinary()
_ = yym9
if false {
} else {
*((*bool)(x.Suspend)) = r.DecodeBool()
}
} }
case "jobTemplate": case "jobTemplate":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.JobTemplate = JobTemplateSpec{} x.JobTemplate = JobTemplateSpec{}
} else { } else {
yyv9 := &x.JobTemplate yyv10 := &x.JobTemplate
yyv9.CodecDecodeSelf(d) yyv10.CodecDecodeSelf(d)
} }
default: default:
z.DecStructFieldNotFound(-1, yys3) z.DecStructFieldNotFound(-1, yys3)
@ -3743,16 +3763,16 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyj10 int var yyj11 int
var yyb10 bool var yyb11 bool
var yyhl10 bool = l >= 0 var yyhl11 bool = l >= 0
yyj10++ yyj11++
if yyhl10 { if yyhl11 {
yyb10 = yyj10 > l yyb11 = yyj11 > l
} else { } else {
yyb10 = r.CheckBreak() yyb11 = r.CheckBreak()
} }
if yyb10 { if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -3762,13 +3782,13 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
} else { } else {
x.Schedule = string(r.DecodeString()) x.Schedule = string(r.DecodeString())
} }
yyj10++ yyj11++
if yyhl10 { if yyhl11 {
yyb10 = yyj10 > l yyb11 = yyj11 > l
} else { } else {
yyb10 = r.CheckBreak() yyb11 = r.CheckBreak()
} }
if yyb10 { if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -3781,20 +3801,20 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
if x.StartingDeadlineSeconds == nil { if x.StartingDeadlineSeconds == nil {
x.StartingDeadlineSeconds = new(int64) x.StartingDeadlineSeconds = new(int64)
} }
yym13 := z.DecBinary() yym14 := z.DecBinary()
_ = yym13 _ = yym14
if false { if false {
} else { } else {
*((*int64)(x.StartingDeadlineSeconds)) = int64(r.DecodeInt(64)) *((*int64)(x.StartingDeadlineSeconds)) = int64(r.DecodeInt(64))
} }
} }
yyj10++ yyj11++
if yyhl10 { if yyhl11 {
yyb10 = yyj10 > l yyb11 = yyj11 > l
} else { } else {
yyb10 = r.CheckBreak() yyb11 = r.CheckBreak()
} }
if yyb10 { if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -3804,29 +3824,39 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
} else { } else {
x.ConcurrencyPolicy = ConcurrencyPolicy(r.DecodeString()) x.ConcurrencyPolicy = ConcurrencyPolicy(r.DecodeString())
} }
yyj10++ yyj11++
if yyhl10 { if yyhl11 {
yyb10 = yyj10 > l yyb11 = yyj11 > l
} else { } else {
yyb10 = r.CheckBreak() yyb11 = r.CheckBreak()
} }
if yyb10 { if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
z.DecSendContainerState(codecSelfer_containerArrayElem1234) z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Suspend = false if x.Suspend != nil {
} else { x.Suspend = nil
x.Suspend = bool(r.DecodeBool())
} }
yyj10++
if yyhl10 {
yyb10 = yyj10 > l
} else { } else {
yyb10 = r.CheckBreak() if x.Suspend == nil {
x.Suspend = new(bool)
} }
if yyb10 { yym17 := z.DecBinary()
_ = yym17
if false {
} else {
*((*bool)(x.Suspend)) = r.DecodeBool()
}
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
} else {
yyb11 = r.CheckBreak()
}
if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -3834,21 +3864,21 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.JobTemplate = JobTemplateSpec{} x.JobTemplate = JobTemplateSpec{}
} else { } else {
yyv16 := &x.JobTemplate yyv18 := &x.JobTemplate
yyv16.CodecDecodeSelf(d) yyv18.CodecDecodeSelf(d)
} }
for { for {
yyj10++ yyj11++
if yyhl10 { if yyhl11 {
yyb10 = yyj10 > l yyb11 = yyj11 > l
} else { } else {
yyb10 = r.CheckBreak() yyb11 = r.CheckBreak()
} }
if yyb10 { if yyb11 {
break break
} }
z.DecSendContainerState(codecSelfer_containerArrayElem1234) z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj10-1, "") z.DecStructFieldNotFound(yyj11-1, "")
} }
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} }

View File

@ -286,7 +286,13 @@ func DeepCopy_v2alpha1_ScheduledJobSpec(in ScheduledJobSpec, out *ScheduledJobSp
out.StartingDeadlineSeconds = nil out.StartingDeadlineSeconds = nil
} }
out.ConcurrencyPolicy = in.ConcurrencyPolicy out.ConcurrencyPolicy = in.ConcurrencyPolicy
out.Suspend = in.Suspend if in.Suspend != nil {
in, out := in.Suspend, &out.Suspend
*out = new(bool)
**out = *in
} else {
out.Suspend = nil
}
if err := DeepCopy_v2alpha1_JobTemplateSpec(in.JobTemplate, &out.JobTemplate, c); err != nil { if err := DeepCopy_v2alpha1_JobTemplateSpec(in.JobTemplate, &out.JobTemplate, c); err != nil {
return err return err
} }

View File

@ -636,14 +636,16 @@ func (m *ScheduledJobSpec) MarshalTo(data []byte) (int, error) {
i++ i++
i = encodeVarintGenerated(data, i, uint64(len(m.ConcurrencyPolicy))) i = encodeVarintGenerated(data, i, uint64(len(m.ConcurrencyPolicy)))
i += copy(data[i:], m.ConcurrencyPolicy) i += copy(data[i:], m.ConcurrencyPolicy)
if m.Suspend != nil {
data[i] = 0x20 data[i] = 0x20
i++ i++
if m.Suspend { if *m.Suspend {
data[i] = 1 data[i] = 1
} else { } else {
data[i] = 0 data[i] = 0
} }
i++ i++
}
data[i] = 0x2a data[i] = 0x2a
i++ i++
i = encodeVarintGenerated(data, i, uint64(m.JobTemplate.Size())) i = encodeVarintGenerated(data, i, uint64(m.JobTemplate.Size()))
@ -905,7 +907,9 @@ func (m *ScheduledJobSpec) Size() (n int) {
} }
l = len(m.ConcurrencyPolicy) l = len(m.ConcurrencyPolicy)
n += 1 + l + sovGenerated(uint64(l)) n += 1 + l + sovGenerated(uint64(l))
if m.Suspend != nil {
n += 2 n += 2
}
l = m.JobTemplate.Size() l = m.JobTemplate.Size()
n += 1 + l + sovGenerated(uint64(l)) n += 1 + l + sovGenerated(uint64(l))
return n return n
@ -2741,7 +2745,8 @@ func (m *ScheduledJobSpec) Unmarshal(data []byte) error {
break break
} }
} }
m.Suspend = bool(v != 0) b := bool(v != 0)
m.Suspend = &b
case 5: case 5:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field JobTemplate", wireType) return fmt.Errorf("proto: wrong wireType = %d for field JobTemplate", wireType)

View File

@ -24,7 +24,6 @@ package k8s.io.kubernetes.pkg.apis.batch.v2alpha1;
import "k8s.io/kubernetes/pkg/api/resource/generated.proto"; import "k8s.io/kubernetes/pkg/api/resource/generated.proto";
import "k8s.io/kubernetes/pkg/api/unversioned/generated.proto"; import "k8s.io/kubernetes/pkg/api/unversioned/generated.proto";
import "k8s.io/kubernetes/pkg/api/v1/generated.proto"; import "k8s.io/kubernetes/pkg/api/v1/generated.proto";
import "k8s.io/kubernetes/pkg/runtime/generated.proto";
import "k8s.io/kubernetes/pkg/util/intstr/generated.proto"; import "k8s.io/kubernetes/pkg/util/intstr/generated.proto";
// Package-wide variables from generator "generated". // Package-wide variables from generator "generated".

View File

@ -3578,33 +3578,43 @@ func (x *ScheduledJobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
} }
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
yym15 := z.EncBinary() if x.Suspend == nil {
_ = yym15 r.EncodeNil()
} else {
yy15 := *x.Suspend
yym16 := z.EncBinary()
_ = yym16
if false { if false {
} else { } else {
r.EncodeBool(bool(x.Suspend)) r.EncodeBool(bool(yy15))
}
} }
} else { } else {
z.EncSendContainerState(codecSelfer_containerMapKey1234) z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("suspend")) r.EncodeString(codecSelferC_UTF81234, string("suspend"))
z.EncSendContainerState(codecSelfer_containerMapValue1234) z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym16 := z.EncBinary() if x.Suspend == nil {
_ = yym16 r.EncodeNil()
} else {
yy17 := *x.Suspend
yym18 := z.EncBinary()
_ = yym18
if false { if false {
} else { } else {
r.EncodeBool(bool(x.Suspend)) r.EncodeBool(bool(yy17))
}
} }
} }
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
yy18 := &x.JobTemplate yy20 := &x.JobTemplate
yy18.CodecEncodeSelf(e) yy20.CodecEncodeSelf(e)
} else { } else {
z.EncSendContainerState(codecSelfer_containerMapKey1234) z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("jobTemplate")) r.EncodeString(codecSelferC_UTF81234, string("jobTemplate"))
z.EncSendContainerState(codecSelfer_containerMapValue1234) z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy20 := &x.JobTemplate yy22 := &x.JobTemplate
yy20.CodecEncodeSelf(e) yy22.CodecEncodeSelf(e)
} }
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234) z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
@ -3697,16 +3707,26 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
} }
case "suspend": case "suspend":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Suspend = false if x.Suspend != nil {
x.Suspend = nil
}
} else { } else {
x.Suspend = bool(r.DecodeBool()) if x.Suspend == nil {
x.Suspend = new(bool)
}
yym9 := z.DecBinary()
_ = yym9
if false {
} else {
*((*bool)(x.Suspend)) = r.DecodeBool()
}
} }
case "jobTemplate": case "jobTemplate":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.JobTemplate = JobTemplateSpec{} x.JobTemplate = JobTemplateSpec{}
} else { } else {
yyv9 := &x.JobTemplate yyv10 := &x.JobTemplate
yyv9.CodecDecodeSelf(d) yyv10.CodecDecodeSelf(d)
} }
default: default:
z.DecStructFieldNotFound(-1, yys3) z.DecStructFieldNotFound(-1, yys3)
@ -3719,16 +3739,16 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyj10 int var yyj11 int
var yyb10 bool var yyb11 bool
var yyhl10 bool = l >= 0 var yyhl11 bool = l >= 0
yyj10++ yyj11++
if yyhl10 { if yyhl11 {
yyb10 = yyj10 > l yyb11 = yyj11 > l
} else { } else {
yyb10 = r.CheckBreak() yyb11 = r.CheckBreak()
} }
if yyb10 { if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -3738,13 +3758,13 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
} else { } else {
x.Schedule = string(r.DecodeString()) x.Schedule = string(r.DecodeString())
} }
yyj10++ yyj11++
if yyhl10 { if yyhl11 {
yyb10 = yyj10 > l yyb11 = yyj11 > l
} else { } else {
yyb10 = r.CheckBreak() yyb11 = r.CheckBreak()
} }
if yyb10 { if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -3757,20 +3777,20 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
if x.StartingDeadlineSeconds == nil { if x.StartingDeadlineSeconds == nil {
x.StartingDeadlineSeconds = new(int64) x.StartingDeadlineSeconds = new(int64)
} }
yym13 := z.DecBinary() yym14 := z.DecBinary()
_ = yym13 _ = yym14
if false { if false {
} else { } else {
*((*int64)(x.StartingDeadlineSeconds)) = int64(r.DecodeInt(64)) *((*int64)(x.StartingDeadlineSeconds)) = int64(r.DecodeInt(64))
} }
} }
yyj10++ yyj11++
if yyhl10 { if yyhl11 {
yyb10 = yyj10 > l yyb11 = yyj11 > l
} else { } else {
yyb10 = r.CheckBreak() yyb11 = r.CheckBreak()
} }
if yyb10 { if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -3780,29 +3800,39 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
} else { } else {
x.ConcurrencyPolicy = ConcurrencyPolicy(r.DecodeString()) x.ConcurrencyPolicy = ConcurrencyPolicy(r.DecodeString())
} }
yyj10++ yyj11++
if yyhl10 { if yyhl11 {
yyb10 = yyj10 > l yyb11 = yyj11 > l
} else { } else {
yyb10 = r.CheckBreak() yyb11 = r.CheckBreak()
} }
if yyb10 { if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
z.DecSendContainerState(codecSelfer_containerArrayElem1234) z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Suspend = false if x.Suspend != nil {
} else { x.Suspend = nil
x.Suspend = bool(r.DecodeBool())
} }
yyj10++
if yyhl10 {
yyb10 = yyj10 > l
} else { } else {
yyb10 = r.CheckBreak() if x.Suspend == nil {
x.Suspend = new(bool)
} }
if yyb10 { yym17 := z.DecBinary()
_ = yym17
if false {
} else {
*((*bool)(x.Suspend)) = r.DecodeBool()
}
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
} else {
yyb11 = r.CheckBreak()
}
if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -3810,21 +3840,21 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.JobTemplate = JobTemplateSpec{} x.JobTemplate = JobTemplateSpec{}
} else { } else {
yyv16 := &x.JobTemplate yyv18 := &x.JobTemplate
yyv16.CodecDecodeSelf(d) yyv18.CodecDecodeSelf(d)
} }
for { for {
yyj10++ yyj11++
if yyhl10 { if yyhl11 {
yyb10 = yyj10 > l yyb11 = yyj11 > l
} else { } else {
yyb10 = r.CheckBreak() yyb11 = r.CheckBreak()
} }
if yyb10 { if yyb11 {
break break
} }
z.DecSendContainerState(codecSelfer_containerArrayElem1234) z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj10-1, "") z.DecStructFieldNotFound(yyj11-1, "")
} }
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} }