diff --git a/api/swagger-spec/batch_v1.json b/api/swagger-spec/batch_v1.json
index 85fda7525e3..8cc5288359c 100644
--- a/api/swagger-spec/batch_v1.json
+++ b/api/swagger-spec/batch_v1.json
@@ -991,7 +991,7 @@
"completions": {
"type": "integer",
"format": "int32",
- "description": "Completions specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job."
+ "description": "Completions specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md"
},
"activeDeadlineSeconds": {
"type": "integer",
@@ -1000,7 +1000,11 @@
},
"selector": {
"$ref": "v1.LabelSelector",
- "description": "Selector is a label query over pods that should match the pod count. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors"
+ "description": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors"
+ },
+ "manualSelector": {
+ "type": "boolean",
+ "description": "ManualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md"
},
"template": {
"$ref": "v1.PodTemplateSpec",
diff --git a/api/swagger-spec/extensions_v1beta1.json b/api/swagger-spec/extensions_v1beta1.json
index 56eb9eadc36..48834bc8ab0 100644
--- a/api/swagger-spec/extensions_v1beta1.json
+++ b/api/swagger-spec/extensions_v1beta1.json
@@ -7326,7 +7326,7 @@
"completions": {
"type": "integer",
"format": "int32",
- "description": "Completions specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job."
+ "description": "Completions specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md"
},
"activeDeadlineSeconds": {
"type": "integer",
@@ -7335,7 +7335,11 @@
},
"selector": {
"$ref": "v1beta1.LabelSelector",
- "description": "Selector is a label query over pods that should match the pod count. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors"
+ "description": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors"
+ },
+ "autoSelector": {
+ "type": "boolean",
+ "description": "AutoSelector controls generation of pod labels and pod selectors. It was not present in the original extensions/v1beta1 Job definition, but exists to allow conversion from batch/v1 Jobs, where it corresponds to, but has the opposite meaning as, ManualSelector. More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md"
},
"template": {
"$ref": "v1.PodTemplateSpec",
diff --git a/docs/api-reference/extensions/v1beta1/definitions.html b/docs/api-reference/extensions/v1beta1/definitions.html
index 46b3aec66e4..bd650c29b8f 100755
--- a/docs/api-reference/extensions/v1beta1/definitions.html
+++ b/docs/api-reference/extensions/v1beta1/definitions.html
@@ -4437,7 +4437,7 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
completions |
-Completions specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. |
+Completions specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md |
false |
integer (int32) |
|
@@ -4451,12 +4451,19 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
selector |
-Selector is a label query over pods that should match the pod count. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors |
+Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors |
false |
v1beta1.LabelSelector |
|
+autoSelector |
+AutoSelector controls generation of pod labels and pod selectors. It was not present in the original extensions/v1beta1 Job definition, but exists to allow conversion from batch/v1 Jobs, where it corresponds to, but has the opposite meaning as, ManualSelector. More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md |
+false |
+boolean |
+false |
+
+
template |
Template is the object that describes the pod that will be created when executing a job. More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md |
true |
diff --git a/pkg/apis/batch/v1/conversion_generated.go b/pkg/apis/batch/v1/conversion_generated.go
index c7e4104922a..9a7b4876f60 100644
--- a/pkg/apis/batch/v1/conversion_generated.go
+++ b/pkg/apis/batch/v1/conversion_generated.go
@@ -2681,6 +2681,12 @@ func autoConvert_v1_JobSpec_To_extensions_JobSpec(in *JobSpec, out *extensions.J
} else {
out.Selector = nil
}
+ if in.ManualSelector != nil {
+ out.ManualSelector = new(bool)
+ *out.ManualSelector = *in.ManualSelector
+ } else {
+ out.ManualSelector = nil
+ }
if err := Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
@@ -2885,6 +2891,12 @@ func autoConvert_extensions_JobSpec_To_v1_JobSpec(in *extensions.JobSpec, out *J
} else {
out.Selector = nil
}
+ if in.ManualSelector != nil {
+ out.ManualSelector = new(bool)
+ *out.ManualSelector = *in.ManualSelector
+ } else {
+ out.ManualSelector = nil
+ }
if err := Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
diff --git a/pkg/apis/batch/v1/deep_copy_generated.go b/pkg/apis/batch/v1/deep_copy_generated.go
index e91102dd970..3ddbd6d2b7a 100644
--- a/pkg/apis/batch/v1/deep_copy_generated.go
+++ b/pkg/apis/batch/v1/deep_copy_generated.go
@@ -1076,6 +1076,12 @@ func deepCopy_v1_JobSpec(in JobSpec, out *JobSpec, c *conversion.Cloner) error {
} else {
out.Selector = nil
}
+ if in.ManualSelector != nil {
+ out.ManualSelector = new(bool)
+ *out.ManualSelector = *in.ManualSelector
+ } else {
+ out.ManualSelector = nil
+ }
if err := deepCopy_v1_PodTemplateSpec(in.Template, &out.Template, c); err != nil {
return err
}
diff --git a/pkg/apis/batch/v1/types.generated.go b/pkg/apis/batch/v1/types.generated.go
index f73d599bb71..2c07db2168e 100644
--- a/pkg/apis/batch/v1/types.generated.go
+++ b/pkg/apis/batch/v1/types.generated.go
@@ -778,16 +778,17 @@ func (x *JobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
} else {
yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray
- var yyq2 [5]bool
+ var yyq2 [6]bool
_, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false
yyq2[0] = x.Parallelism != nil
yyq2[1] = x.Completions != nil
yyq2[2] = x.ActiveDeadlineSeconds != nil
yyq2[3] = x.Selector != nil
+ yyq2[4] = x.ManualSelector != nil
var yynn2 int
if yyr2 || yy2arr2 {
- r.EncodeArrayStart(5)
+ r.EncodeArrayStart(6)
} else {
yynn2 = 1
for _, b := range yyq2 {
@@ -928,14 +929,49 @@ func (x *JobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- yy22 := &x.Template
- yy22.CodecEncodeSelf(e)
+ if yyq2[4] {
+ if x.ManualSelector == nil {
+ r.EncodeNil()
+ } else {
+ yy22 := *x.ManualSelector
+ yym23 := z.EncBinary()
+ _ = yym23
+ if false {
+ } else {
+ r.EncodeBool(bool(yy22))
+ }
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[4] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("manualSelector"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ if x.ManualSelector == nil {
+ r.EncodeNil()
+ } else {
+ yy24 := *x.ManualSelector
+ yym25 := z.EncBinary()
+ _ = yym25
+ if false {
+ } else {
+ r.EncodeBool(bool(yy24))
+ }
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ yy27 := &x.Template
+ yy27.CodecEncodeSelf(e)
} else {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("template"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yy24 := &x.Template
- yy24.CodecEncodeSelf(e)
+ yy29 := &x.Template
+ yy29.CodecEncodeSelf(e)
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
@@ -1057,12 +1093,28 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
}
x.Selector.CodecDecodeSelf(d)
}
+ case "manualSelector":
+ if r.TryDecodeAsNil() {
+ if x.ManualSelector != nil {
+ x.ManualSelector = nil
+ }
+ } else {
+ if x.ManualSelector == nil {
+ x.ManualSelector = new(bool)
+ }
+ yym12 := z.DecBinary()
+ _ = yym12
+ if false {
+ } else {
+ *((*bool)(x.ManualSelector)) = r.DecodeBool()
+ }
+ }
case "template":
if r.TryDecodeAsNil() {
x.Template = pkg2_v1.PodTemplateSpec{}
} else {
- yyv11 := &x.Template
- yyv11.CodecDecodeSelf(d)
+ yyv13 := &x.Template
+ yyv13.CodecDecodeSelf(d)
}
default:
z.DecStructFieldNotFound(-1, yys3)
@@ -1075,16 +1127,16 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
- var yyj12 int
- var yyb12 bool
- var yyhl12 bool = l >= 0
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ var yyj14 int
+ var yyb14 bool
+ var yyhl14 bool = l >= 0
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -1097,20 +1149,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.Parallelism == nil {
x.Parallelism = new(int32)
}
- yym14 := z.DecBinary()
- _ = yym14
+ yym16 := z.DecBinary()
+ _ = yym16
if false {
} else {
*((*int32)(x.Parallelism)) = int32(r.DecodeInt(32))
}
}
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -1123,20 +1175,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.Completions == nil {
x.Completions = new(int32)
}
- yym16 := z.DecBinary()
- _ = yym16
+ yym18 := z.DecBinary()
+ _ = yym18
if false {
} else {
*((*int32)(x.Completions)) = int32(r.DecodeInt(32))
}
}
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -1149,20 +1201,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.ActiveDeadlineSeconds == nil {
x.ActiveDeadlineSeconds = new(int64)
}
- yym18 := z.DecBinary()
- _ = yym18
+ yym20 := z.DecBinary()
+ _ = yym20
if false {
} else {
*((*int64)(x.ActiveDeadlineSeconds)) = int64(r.DecodeInt(64))
}
}
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -1177,13 +1229,39 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
}
x.Selector.CodecDecodeSelf(d)
}
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ if x.ManualSelector != nil {
+ x.ManualSelector = nil
+ }
+ } else {
+ if x.ManualSelector == nil {
+ x.ManualSelector = new(bool)
+ }
+ yym23 := z.DecBinary()
+ _ = yym23
+ if false {
+ } else {
+ *((*bool)(x.ManualSelector)) = r.DecodeBool()
+ }
+ }
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
+ } else {
+ yyb14 = r.CheckBreak()
+ }
+ if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -1191,21 +1269,21 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Template = pkg2_v1.PodTemplateSpec{}
} else {
- yyv20 := &x.Template
- yyv20.CodecDecodeSelf(d)
+ yyv24 := &x.Template
+ yyv24.CodecDecodeSelf(d)
}
for {
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- z.DecStructFieldNotFound(yyj12-1, "")
+ z.DecStructFieldNotFound(yyj14-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
@@ -2789,7 +2867,7 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) {
yyrg1 := len(yyv1) > 0
yyv21 := yyv1
- yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 632)
+ yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 640)
if yyrt1 {
if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1]
diff --git a/pkg/apis/batch/v1/types_swagger_doc_generated.go b/pkg/apis/batch/v1/types_swagger_doc_generated.go
index 8e93bb83866..8b52558439e 100644
--- a/pkg/apis/batch/v1/types_swagger_doc_generated.go
+++ b/pkg/apis/batch/v1/types_swagger_doc_generated.go
@@ -65,9 +65,10 @@ func (JobList) SwaggerDoc() map[string]string {
var map_JobSpec = map[string]string{
"": "JobSpec describes how the job execution will look like.",
"parallelism": "Parallelism specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md",
- "completions": "Completions specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job.",
+ "completions": "Completions specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md",
"activeDeadlineSeconds": "Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer",
- "selector": "Selector is a label query over pods that should match the pod count. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors",
+ "selector": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors",
+ "manualSelector": "ManualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md",
"template": "Template is the object that describes the pod that will be created when executing a job. More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md",
}
diff --git a/pkg/apis/extensions/types.generated.go b/pkg/apis/extensions/types.generated.go
index 719562774b6..2a29d959373 100644
--- a/pkg/apis/extensions/types.generated.go
+++ b/pkg/apis/extensions/types.generated.go
@@ -9925,16 +9925,17 @@ func (x *JobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
} else {
yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray
- var yyq2 [5]bool
+ var yyq2 [6]bool
_, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false
yyq2[0] = x.Parallelism != nil
yyq2[1] = x.Completions != nil
yyq2[2] = x.ActiveDeadlineSeconds != nil
yyq2[3] = x.Selector != nil
+ yyq2[4] = x.ManualSelector != nil
var yynn2 int
if yyr2 || yy2arr2 {
- r.EncodeArrayStart(5)
+ r.EncodeArrayStart(6)
} else {
yynn2 = 1
for _, b := range yyq2 {
@@ -10087,14 +10088,49 @@ func (x *JobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- yy22 := &x.Template
- yy22.CodecEncodeSelf(e)
+ if yyq2[4] {
+ if x.ManualSelector == nil {
+ r.EncodeNil()
+ } else {
+ yy22 := *x.ManualSelector
+ yym23 := z.EncBinary()
+ _ = yym23
+ if false {
+ } else {
+ r.EncodeBool(bool(yy22))
+ }
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[4] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("manualSelector"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ if x.ManualSelector == nil {
+ r.EncodeNil()
+ } else {
+ yy24 := *x.ManualSelector
+ yym25 := z.EncBinary()
+ _ = yym25
+ if false {
+ } else {
+ r.EncodeBool(bool(yy24))
+ }
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ yy27 := &x.Template
+ yy27.CodecEncodeSelf(e)
} else {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("template"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yy24 := &x.Template
- yy24.CodecEncodeSelf(e)
+ yy29 := &x.Template
+ yy29.CodecEncodeSelf(e)
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
@@ -10222,12 +10258,28 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
z.DecFallback(x.Selector, false)
}
}
+ case "manualSelector":
+ if r.TryDecodeAsNil() {
+ if x.ManualSelector != nil {
+ x.ManualSelector = nil
+ }
+ } else {
+ if x.ManualSelector == nil {
+ x.ManualSelector = new(bool)
+ }
+ yym13 := z.DecBinary()
+ _ = yym13
+ if false {
+ } else {
+ *((*bool)(x.ManualSelector)) = r.DecodeBool()
+ }
+ }
case "template":
if r.TryDecodeAsNil() {
x.Template = pkg2_api.PodTemplateSpec{}
} else {
- yyv12 := &x.Template
- yyv12.CodecDecodeSelf(d)
+ yyv14 := &x.Template
+ yyv14.CodecDecodeSelf(d)
}
default:
z.DecStructFieldNotFound(-1, yys3)
@@ -10240,16 +10292,16 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
- var yyj13 int
- var yyb13 bool
- var yyhl13 bool = l >= 0
- yyj13++
- if yyhl13 {
- yyb13 = yyj13 > l
+ var yyj15 int
+ var yyb15 bool
+ var yyhl15 bool = l >= 0
+ yyj15++
+ if yyhl15 {
+ yyb15 = yyj15 > l
} else {
- yyb13 = r.CheckBreak()
+ yyb15 = r.CheckBreak()
}
- if yyb13 {
+ if yyb15 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -10262,20 +10314,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.Parallelism == nil {
x.Parallelism = new(int)
}
- yym15 := z.DecBinary()
- _ = yym15
+ yym17 := z.DecBinary()
+ _ = yym17
if false {
} else {
*((*int)(x.Parallelism)) = int(r.DecodeInt(codecSelferBitsize1234))
}
}
- yyj13++
- if yyhl13 {
- yyb13 = yyj13 > l
+ yyj15++
+ if yyhl15 {
+ yyb15 = yyj15 > l
} else {
- yyb13 = r.CheckBreak()
+ yyb15 = r.CheckBreak()
}
- if yyb13 {
+ if yyb15 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -10288,20 +10340,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.Completions == nil {
x.Completions = new(int)
}
- yym17 := z.DecBinary()
- _ = yym17
+ yym19 := z.DecBinary()
+ _ = yym19
if false {
} else {
*((*int)(x.Completions)) = int(r.DecodeInt(codecSelferBitsize1234))
}
}
- yyj13++
- if yyhl13 {
- yyb13 = yyj13 > l
+ yyj15++
+ if yyhl15 {
+ yyb15 = yyj15 > l
} else {
- yyb13 = r.CheckBreak()
+ yyb15 = r.CheckBreak()
}
- if yyb13 {
+ if yyb15 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -10314,20 +10366,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.ActiveDeadlineSeconds == nil {
x.ActiveDeadlineSeconds = new(int64)
}
- yym19 := z.DecBinary()
- _ = yym19
+ yym21 := z.DecBinary()
+ _ = yym21
if false {
} else {
*((*int64)(x.ActiveDeadlineSeconds)) = int64(r.DecodeInt(64))
}
}
- yyj13++
- if yyhl13 {
- yyb13 = yyj13 > l
+ yyj15++
+ if yyhl15 {
+ yyb15 = yyj15 > l
} else {
- yyb13 = r.CheckBreak()
+ yyb15 = r.CheckBreak()
}
- if yyb13 {
+ if yyb15 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -10340,21 +10392,47 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.Selector == nil {
x.Selector = new(pkg1_unversioned.LabelSelector)
}
- yym21 := z.DecBinary()
- _ = yym21
+ yym23 := z.DecBinary()
+ _ = yym23
if false {
} else if z.HasExtensions() && z.DecExt(x.Selector) {
} else {
z.DecFallback(x.Selector, false)
}
}
- yyj13++
- if yyhl13 {
- yyb13 = yyj13 > l
+ yyj15++
+ if yyhl15 {
+ yyb15 = yyj15 > l
} else {
- yyb13 = r.CheckBreak()
+ yyb15 = r.CheckBreak()
}
- if yyb13 {
+ if yyb15 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ if x.ManualSelector != nil {
+ x.ManualSelector = nil
+ }
+ } else {
+ if x.ManualSelector == nil {
+ x.ManualSelector = new(bool)
+ }
+ yym25 := z.DecBinary()
+ _ = yym25
+ if false {
+ } else {
+ *((*bool)(x.ManualSelector)) = r.DecodeBool()
+ }
+ }
+ yyj15++
+ if yyhl15 {
+ yyb15 = yyj15 > l
+ } else {
+ yyb15 = r.CheckBreak()
+ }
+ if yyb15 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -10362,21 +10440,21 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Template = pkg2_api.PodTemplateSpec{}
} else {
- yyv22 := &x.Template
- yyv22.CodecDecodeSelf(d)
+ yyv26 := &x.Template
+ yyv26.CodecDecodeSelf(d)
}
for {
- yyj13++
- if yyhl13 {
- yyb13 = yyj13 > l
+ yyj15++
+ if yyhl15 {
+ yyb15 = yyj15 > l
} else {
- yyb13 = r.CheckBreak()
+ yyb15 = r.CheckBreak()
}
- if yyb13 {
+ if yyb15 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- z.DecStructFieldNotFound(yyj13-1, "")
+ z.DecStructFieldNotFound(yyj15-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
@@ -19286,7 +19364,7 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) {
yyrg1 := len(yyv1) > 0
yyv21 := yyv1
- yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 616)
+ yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 624)
if yyrt1 {
if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1]
diff --git a/pkg/apis/extensions/v1beta1/conversion_generated.go b/pkg/apis/extensions/v1beta1/conversion_generated.go
index 6d4d3dc59fc..7a57339c671 100644
--- a/pkg/apis/extensions/v1beta1/conversion_generated.go
+++ b/pkg/apis/extensions/v1beta1/conversion_generated.go
@@ -3460,16 +3460,13 @@ func autoConvert_extensions_JobSpec_To_v1beta1_JobSpec(in *extensions.JobSpec, o
} else {
out.Selector = nil
}
+ // in.ManualSelector has no peer in out
if err := Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
return nil
}
-func Convert_extensions_JobSpec_To_v1beta1_JobSpec(in *extensions.JobSpec, out *JobSpec, s conversion.Scope) error {
- return autoConvert_extensions_JobSpec_To_v1beta1_JobSpec(in, out, s)
-}
-
func autoConvert_extensions_JobStatus_To_v1beta1_JobStatus(in *extensions.JobStatus, out *JobStatus, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*extensions.JobStatus))(in)
@@ -4730,16 +4727,13 @@ func autoConvert_v1beta1_JobSpec_To_extensions_JobSpec(in *JobSpec, out *extensi
} else {
out.Selector = nil
}
+ // in.AutoSelector has no peer in out
if err := Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
return nil
}
-func Convert_v1beta1_JobSpec_To_extensions_JobSpec(in *JobSpec, out *extensions.JobSpec, s conversion.Scope) error {
- return autoConvert_v1beta1_JobSpec_To_extensions_JobSpec(in, out, s)
-}
-
func autoConvert_v1beta1_JobStatus_To_extensions_JobStatus(in *JobStatus, out *extensions.JobStatus, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*JobStatus))(in)
diff --git a/pkg/apis/extensions/v1beta1/deep_copy_generated.go b/pkg/apis/extensions/v1beta1/deep_copy_generated.go
index 447f17a5466..50684723bc0 100644
--- a/pkg/apis/extensions/v1beta1/deep_copy_generated.go
+++ b/pkg/apis/extensions/v1beta1/deep_copy_generated.go
@@ -1565,6 +1565,12 @@ func deepCopy_v1beta1_JobSpec(in JobSpec, out *JobSpec, c *conversion.Cloner) er
} else {
out.Selector = nil
}
+ if in.AutoSelector != nil {
+ out.AutoSelector = new(bool)
+ *out.AutoSelector = *in.AutoSelector
+ } else {
+ out.AutoSelector = nil
+ }
if err := deepCopy_v1_PodTemplateSpec(in.Template, &out.Template, c); err != nil {
return err
}
diff --git a/pkg/apis/extensions/v1beta1/types.generated.go b/pkg/apis/extensions/v1beta1/types.generated.go
index 5bd64943027..9022e6e5435 100644
--- a/pkg/apis/extensions/v1beta1/types.generated.go
+++ b/pkg/apis/extensions/v1beta1/types.generated.go
@@ -9935,16 +9935,17 @@ func (x *JobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
} else {
yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray
- var yyq2 [5]bool
+ var yyq2 [6]bool
_, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false
yyq2[0] = x.Parallelism != nil
yyq2[1] = x.Completions != nil
yyq2[2] = x.ActiveDeadlineSeconds != nil
yyq2[3] = x.Selector != nil
+ yyq2[4] = x.AutoSelector != nil
var yynn2 int
if yyr2 || yy2arr2 {
- r.EncodeArrayStart(5)
+ r.EncodeArrayStart(6)
} else {
yynn2 = 1
for _, b := range yyq2 {
@@ -10085,14 +10086,49 @@ func (x *JobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- yy22 := &x.Template
- yy22.CodecEncodeSelf(e)
+ if yyq2[4] {
+ if x.AutoSelector == nil {
+ r.EncodeNil()
+ } else {
+ yy22 := *x.AutoSelector
+ yym23 := z.EncBinary()
+ _ = yym23
+ if false {
+ } else {
+ r.EncodeBool(bool(yy22))
+ }
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[4] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("autoSelector"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ if x.AutoSelector == nil {
+ r.EncodeNil()
+ } else {
+ yy24 := *x.AutoSelector
+ yym25 := z.EncBinary()
+ _ = yym25
+ if false {
+ } else {
+ r.EncodeBool(bool(yy24))
+ }
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ yy27 := &x.Template
+ yy27.CodecEncodeSelf(e)
} else {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("template"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yy24 := &x.Template
- yy24.CodecEncodeSelf(e)
+ yy29 := &x.Template
+ yy29.CodecEncodeSelf(e)
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
@@ -10214,12 +10250,28 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
}
x.Selector.CodecDecodeSelf(d)
}
+ case "autoSelector":
+ if r.TryDecodeAsNil() {
+ if x.AutoSelector != nil {
+ x.AutoSelector = nil
+ }
+ } else {
+ if x.AutoSelector == nil {
+ x.AutoSelector = new(bool)
+ }
+ yym12 := z.DecBinary()
+ _ = yym12
+ if false {
+ } else {
+ *((*bool)(x.AutoSelector)) = r.DecodeBool()
+ }
+ }
case "template":
if r.TryDecodeAsNil() {
x.Template = pkg2_v1.PodTemplateSpec{}
} else {
- yyv11 := &x.Template
- yyv11.CodecDecodeSelf(d)
+ yyv13 := &x.Template
+ yyv13.CodecDecodeSelf(d)
}
default:
z.DecStructFieldNotFound(-1, yys3)
@@ -10232,16 +10284,16 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
- var yyj12 int
- var yyb12 bool
- var yyhl12 bool = l >= 0
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ var yyj14 int
+ var yyb14 bool
+ var yyhl14 bool = l >= 0
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -10254,20 +10306,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.Parallelism == nil {
x.Parallelism = new(int32)
}
- yym14 := z.DecBinary()
- _ = yym14
+ yym16 := z.DecBinary()
+ _ = yym16
if false {
} else {
*((*int32)(x.Parallelism)) = int32(r.DecodeInt(32))
}
}
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -10280,20 +10332,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.Completions == nil {
x.Completions = new(int32)
}
- yym16 := z.DecBinary()
- _ = yym16
+ yym18 := z.DecBinary()
+ _ = yym18
if false {
} else {
*((*int32)(x.Completions)) = int32(r.DecodeInt(32))
}
}
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -10306,20 +10358,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.ActiveDeadlineSeconds == nil {
x.ActiveDeadlineSeconds = new(int64)
}
- yym18 := z.DecBinary()
- _ = yym18
+ yym20 := z.DecBinary()
+ _ = yym20
if false {
} else {
*((*int64)(x.ActiveDeadlineSeconds)) = int64(r.DecodeInt(64))
}
}
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -10334,13 +10386,39 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
}
x.Selector.CodecDecodeSelf(d)
}
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ if x.AutoSelector != nil {
+ x.AutoSelector = nil
+ }
+ } else {
+ if x.AutoSelector == nil {
+ x.AutoSelector = new(bool)
+ }
+ yym23 := z.DecBinary()
+ _ = yym23
+ if false {
+ } else {
+ *((*bool)(x.AutoSelector)) = r.DecodeBool()
+ }
+ }
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
+ } else {
+ yyb14 = r.CheckBreak()
+ }
+ if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -10348,21 +10426,21 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Template = pkg2_v1.PodTemplateSpec{}
} else {
- yyv20 := &x.Template
- yyv20.CodecDecodeSelf(d)
+ yyv24 := &x.Template
+ yyv24.CodecDecodeSelf(d)
}
for {
- yyj12++
- if yyhl12 {
- yyb12 = yyj12 > l
+ yyj14++
+ if yyhl14 {
+ yyb14 = yyj14 > l
} else {
- yyb12 = r.CheckBreak()
+ yyb14 = r.CheckBreak()
}
- if yyb12 {
+ if yyb14 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- z.DecStructFieldNotFound(yyj12-1, "")
+ z.DecStructFieldNotFound(yyj14-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
@@ -20615,7 +20693,7 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) {
yyrg1 := len(yyv1) > 0
yyv21 := yyv1
- yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 632)
+ yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 640)
if yyrt1 {
if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1]
diff --git a/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go b/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go
index 3f29ee3fea9..da3cef13247 100644
--- a/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go
+++ b/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go
@@ -417,9 +417,10 @@ func (JobList) SwaggerDoc() map[string]string {
var map_JobSpec = map[string]string{
"": "JobSpec describes how the job execution will look like.",
"parallelism": "Parallelism specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md",
- "completions": "Completions specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job.",
+ "completions": "Completions specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md",
"activeDeadlineSeconds": "Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer",
- "selector": "Selector is a label query over pods that should match the pod count. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors",
+ "selector": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors",
+ "autoSelector": "AutoSelector controls generation of pod labels and pod selectors. It was not present in the original extensions/v1beta1 Job definition, but exists to allow conversion from batch/v1 Jobs, where it corresponds to, but has the opposite meaning as, ManualSelector. More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md",
"template": "Template is the object that describes the pod that will be created when executing a job. More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md",
}