mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 05:30:26 +00:00
Merge pull request #40932 from peay/cronjob-max-finished-jobs
Automatic merge from submit-queue (batch tested with PRs 40932, 41896, 41815, 41309, 41628) Modify CronJob API to add job history limits, cleanup jobs in controller **What this PR does / why we need it**: As discussed in #34710: this adds two limits to `CronJobSpec`, to limit the number of finished jobs created by a CronJob to keep. **Which issue this PR fixes**: fixes #34710 **Special notes for your reviewer**: cc @soltysh, please have a look and let me know what you think -- I'll then add end to end testing and update the doc in a separate commit. What is the timeline to get this into 1.6? The plan: - [x] API changes - [x] Changing versioned APIs - [x] `types.go` - [x] `defaults.go` (nothing to do) - [x] `conversion.go` (nothing to do?) - [x] `conversion_test.go` (nothing to do?) - [x] Changing the internal structure - [x] `types.go` - [x] `validation.go` - [x] `validation_test.go` - [x] Edit version conversions - [x] Edit (nothing to do?) - [x] Run `hack/update-codegen.sh` - [x] Generate protobuf objects - [x] Run `hack/update-generated-protobuf.sh` - [x] Generate json (un)marshaling code - [x] Run `hack/update-codecgen.sh` - [x] Update fuzzer - [x] Actual logic - [x] Unit tests - [x] End to end tests - [x] Documentation changes and API specs update in separate commit **Release note**: ```release-note Add configurable limits to CronJob resource to specify how many successful and failed jobs are preserved. ```
This commit is contained in:
@@ -40985,6 +40985,11 @@
|
||||
"description": "ConcurrencyPolicy specifies how to treat concurrent executions of a Job.",
|
||||
"type": "string"
|
||||
},
|
||||
"failedJobsHistoryLimit": {
|
||||
"description": "The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.",
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"jobTemplate": {
|
||||
"description": "JobTemplate is the object that describes the job that will be created when executing a CronJob.",
|
||||
"$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.batch.v2alpha1.JobTemplateSpec"
|
||||
@@ -40998,6 +41003,11 @@
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"successfulJobsHistoryLimit": {
|
||||
"description": "The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.",
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"suspend": {
|
||||
"description": "Suspend flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.",
|
||||
"type": "boolean"
|
||||
|
Reference in New Issue
Block a user