Skip to content

Commit 3421a80

Browse files
Merge pull request #126067 from tenzen-y/implement-job-success-policy-e2e
Graduate the JobSuccessPolicy to Beta Kubernetes-commit: 1854839ff08eba7434ebfa98ab84de2d3a62d4ce
2 parents b689d90 + a815b26 commit 3421a80

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

batch/v1/generated.proto

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

batch/v1/types.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ type JobSpec struct {
347347
// When the field is specified, it must be immutable and works only for the Indexed Jobs.
348348
// Once the Job meets the SuccessPolicy, the lingering pods are terminated.
349349
//
350-
// This field is alpha-level. To use this field, you must enable the
351-
// `JobSuccessPolicy` feature gate (disabled by default).
350+
// This field is beta-level. To use this field, you must enable the
351+
// `JobSuccessPolicy` feature gate (enabled by default).
352352
// +optional
353353
SuccessPolicy *SuccessPolicy `json:"successPolicy,omitempty" protobuf:"bytes,16,opt,name=successPolicy"`
354354

@@ -649,8 +649,13 @@ const (
649649
// JobReasonSuccessPolicy reason indicates a SuccessCriteriaMet condition is added due to
650650
// a Job met successPolicy.
651651
// https://kep.k8s.io/3998
652-
// This is currently an alpha field.
652+
// This is currently a beta field.
653653
JobReasonSuccessPolicy string = "SuccessPolicy"
654+
// JobReasonCompletionsReached reason indicates a SuccessCriteriaMet condition is added due to
655+
// a number of succeeded Job pods met completions.
656+
// - https://kep.k8s.io/3998
657+
// This is currently a beta field.
658+
JobReasonCompletionsReached string = "CompletionsReached"
654659
)
655660

656661
// JobCondition describes current state of a job.

batch/v1/types_swagger_doc_generated.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ var map_JobSpec = map[string]string{
116116
"completions": "Specifies the desired number of successfully finished pods the job should be run with. Setting to null 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: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/",
117117
"activeDeadlineSeconds": "Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.",
118118
"podFailurePolicy": "Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure.",
119-
"successPolicy": "successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated.\n\nThis field is alpha-level. To use this field, you must enable the `JobSuccessPolicy` feature gate (disabled by default).",
119+
"successPolicy": "successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated.\n\nThis field is beta-level. To use this field, you must enable the `JobSuccessPolicy` feature gate (enabled by default).",
120120
"backoffLimit": "Specifies the number of retries before marking this job failed. Defaults to 6",
121121
"backoffLimitPerIndex": "Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).",
122122
"maxFailedIndexes": "Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).",

0 commit comments

Comments
 (0)