mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
GA TTLAfterFinish
This commit is contained in:
parent
1123a7041e
commit
3988405c8d
2
api/openapi-spec/swagger.json
generated
2
api/openapi-spec/swagger.json
generated
@ -3619,7 +3619,7 @@
|
|||||||
"description": "Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/"
|
"description": "Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/"
|
||||||
},
|
},
|
||||||
"ttlSecondsAfterFinished": {
|
"ttlSecondsAfterFinished": {
|
||||||
"description": "ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature.",
|
"description": "ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes.",
|
||||||
"format": "int32",
|
"format": "int32",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
|
@ -573,9 +573,6 @@ func startPVProtectionController(ctx context.Context, controllerContext Controll
|
|||||||
}
|
}
|
||||||
|
|
||||||
func startTTLAfterFinishedController(ctx context.Context, controllerContext ControllerContext) (controller.Interface, bool, error) {
|
func startTTLAfterFinishedController(ctx context.Context, controllerContext ControllerContext) (controller.Interface, bool, error) {
|
||||||
if !utilfeature.DefaultFeatureGate.Enabled(features.TTLAfterFinished) {
|
|
||||||
return nil, false, nil
|
|
||||||
}
|
|
||||||
go ttlafterfinished.New(
|
go ttlafterfinished.New(
|
||||||
controllerContext.InformerFactory.Batch().V1().Jobs(),
|
controllerContext.InformerFactory.Batch().V1().Jobs(),
|
||||||
controllerContext.ClientBuilder.ClientOrDie("ttl-after-finished-controller"),
|
controllerContext.ClientBuilder.ClientOrDie("ttl-after-finished-controller"),
|
||||||
|
@ -173,8 +173,6 @@ type JobSpec struct {
|
|||||||
// guarantees (e.g. finalizers) will be honored. If this field is unset,
|
// guarantees (e.g. finalizers) will be honored. If this field is unset,
|
||||||
// the Job won't be automatically deleted. If this field is set to zero,
|
// the Job won't be automatically deleted. If this field is set to zero,
|
||||||
// the Job becomes eligible to be deleted immediately after it finishes.
|
// the Job becomes eligible to be deleted immediately after it finishes.
|
||||||
// This field is alpha-level and is only honored by servers that enable the
|
|
||||||
// TTLAfterFinished feature.
|
|
||||||
// +optional
|
// +optional
|
||||||
TTLSecondsAfterFinished *int32
|
TTLSecondsAfterFinished *int32
|
||||||
|
|
||||||
|
@ -25,11 +25,9 @@ import (
|
|||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
|
||||||
"k8s.io/kubernetes/pkg/apis/batch"
|
"k8s.io/kubernetes/pkg/apis/batch"
|
||||||
api "k8s.io/kubernetes/pkg/apis/core"
|
api "k8s.io/kubernetes/pkg/apis/core"
|
||||||
corevalidation "k8s.io/kubernetes/pkg/apis/core/validation"
|
corevalidation "k8s.io/kubernetes/pkg/apis/core/validation"
|
||||||
"k8s.io/kubernetes/pkg/features"
|
|
||||||
"k8s.io/utils/pointer"
|
"k8s.io/utils/pointer"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -886,24 +884,22 @@ func TestValidateCronJob(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.TTLAfterFinished) {
|
errorCases["spec.jobTemplate.spec.ttlSecondsAfterFinished:must be greater than or equal to 0"] = batch.CronJob{
|
||||||
errorCases["spec.jobTemplate.spec.ttlSecondsAfterFinished:must be greater than or equal to 0"] = batch.CronJob{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
Name: "mycronjob",
|
||||||
Name: "mycronjob",
|
Namespace: metav1.NamespaceDefault,
|
||||||
Namespace: metav1.NamespaceDefault,
|
UID: types.UID("1a2b3c"),
|
||||||
UID: types.UID("1a2b3c"),
|
},
|
||||||
},
|
Spec: batch.CronJobSpec{
|
||||||
Spec: batch.CronJobSpec{
|
Schedule: "* * * * ?",
|
||||||
Schedule: "* * * * ?",
|
ConcurrencyPolicy: batch.AllowConcurrent,
|
||||||
ConcurrencyPolicy: batch.AllowConcurrent,
|
JobTemplate: batch.JobTemplateSpec{
|
||||||
JobTemplate: batch.JobTemplateSpec{
|
Spec: batch.JobSpec{
|
||||||
Spec: batch.JobSpec{
|
TTLSecondsAfterFinished: &negative,
|
||||||
TTLSecondsAfterFinished: &negative,
|
Template: validPodTemplateSpec,
|
||||||
Template: validPodTemplateSpec,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v := range errorCases {
|
for k, v := range errorCases {
|
||||||
|
@ -779,7 +779,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
|
|||||||
RuntimeClass: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23
|
RuntimeClass: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23
|
||||||
NetworkPolicyEndPort: {Default: true, PreRelease: featuregate.Beta},
|
NetworkPolicyEndPort: {Default: true, PreRelease: featuregate.Beta},
|
||||||
ProcMountType: {Default: false, PreRelease: featuregate.Alpha},
|
ProcMountType: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
TTLAfterFinished: {Default: true, PreRelease: featuregate.Beta},
|
TTLAfterFinished: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25
|
||||||
IndexedJob: {Default: true, PreRelease: featuregate.Beta},
|
IndexedJob: {Default: true, PreRelease: featuregate.Beta},
|
||||||
JobTrackingWithFinalizers: {Default: false, PreRelease: featuregate.Alpha},
|
JobTrackingWithFinalizers: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
KubeletPodResources: {Default: true, PreRelease: featuregate.Beta},
|
KubeletPodResources: {Default: true, PreRelease: featuregate.Beta},
|
||||||
|
@ -93,10 +93,6 @@ func (jobStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
|
|||||||
|
|
||||||
job.Generation = 1
|
job.Generation = 1
|
||||||
|
|
||||||
if !utilfeature.DefaultFeatureGate.Enabled(features.TTLAfterFinished) {
|
|
||||||
job.Spec.TTLSecondsAfterFinished = nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if !utilfeature.DefaultFeatureGate.Enabled(features.IndexedJob) {
|
if !utilfeature.DefaultFeatureGate.Enabled(features.IndexedJob) {
|
||||||
job.Spec.CompletionMode = nil
|
job.Spec.CompletionMode = nil
|
||||||
}
|
}
|
||||||
@ -141,10 +137,6 @@ func (jobStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object
|
|||||||
oldJob := old.(*batch.Job)
|
oldJob := old.(*batch.Job)
|
||||||
newJob.Status = oldJob.Status
|
newJob.Status = oldJob.Status
|
||||||
|
|
||||||
if !utilfeature.DefaultFeatureGate.Enabled(features.TTLAfterFinished) && oldJob.Spec.TTLSecondsAfterFinished == nil {
|
|
||||||
newJob.Spec.TTLSecondsAfterFinished = nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if !utilfeature.DefaultFeatureGate.Enabled(features.IndexedJob) && oldJob.Spec.CompletionMode == nil {
|
if !utilfeature.DefaultFeatureGate.Enabled(features.IndexedJob) && oldJob.Spec.CompletionMode == nil {
|
||||||
newJob.Spec.CompletionMode = nil
|
newJob.Spec.CompletionMode = nil
|
||||||
}
|
}
|
||||||
|
@ -42,15 +42,11 @@ var ignoreErrValueDetail = cmpopts.IgnoreFields(field.Error{}, "BadValue", "Deta
|
|||||||
|
|
||||||
func TestJobStrategy(t *testing.T) {
|
func TestJobStrategy(t *testing.T) {
|
||||||
cases := map[string]struct {
|
cases := map[string]struct {
|
||||||
ttlEnabled bool
|
|
||||||
indexedJobEnabled bool
|
indexedJobEnabled bool
|
||||||
suspendJobEnabled bool
|
suspendJobEnabled bool
|
||||||
trackingWithFinalizersEnabled bool
|
trackingWithFinalizersEnabled bool
|
||||||
}{
|
}{
|
||||||
"features disabled": {},
|
"features disabled": {},
|
||||||
"ttl enabled": {
|
|
||||||
ttlEnabled: true,
|
|
||||||
},
|
|
||||||
"indexed job enabled": {
|
"indexed job enabled": {
|
||||||
indexedJobEnabled: true,
|
indexedJobEnabled: true,
|
||||||
},
|
},
|
||||||
@ -63,7 +59,6 @@ func TestJobStrategy(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for name, tc := range cases {
|
for name, tc := range cases {
|
||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.TTLAfterFinished, tc.ttlEnabled)()
|
|
||||||
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IndexedJob, tc.indexedJobEnabled)()
|
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IndexedJob, tc.indexedJobEnabled)()
|
||||||
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.SuspendJob, tc.suspendJobEnabled)()
|
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.SuspendJob, tc.suspendJobEnabled)()
|
||||||
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.JobTrackingWithFinalizers, tc.trackingWithFinalizersEnabled)()
|
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.JobTrackingWithFinalizers, tc.trackingWithFinalizersEnabled)()
|
||||||
@ -73,7 +68,6 @@ func TestJobStrategy(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testJobStrategy(t *testing.T) {
|
func testJobStrategy(t *testing.T) {
|
||||||
ttlEnabled := utilfeature.DefaultFeatureGate.Enabled(features.TTLAfterFinished)
|
|
||||||
indexedJobEnabled := utilfeature.DefaultFeatureGate.Enabled(features.IndexedJob)
|
indexedJobEnabled := utilfeature.DefaultFeatureGate.Enabled(features.IndexedJob)
|
||||||
suspendJobEnabled := utilfeature.DefaultFeatureGate.Enabled(features.SuspendJob)
|
suspendJobEnabled := utilfeature.DefaultFeatureGate.Enabled(features.SuspendJob)
|
||||||
trackingWithFinalizersEnabled := utilfeature.DefaultFeatureGate.Enabled(features.JobTrackingWithFinalizers)
|
trackingWithFinalizersEnabled := utilfeature.DefaultFeatureGate.Enabled(features.JobTrackingWithFinalizers)
|
||||||
@ -133,9 +127,6 @@ func testJobStrategy(t *testing.T) {
|
|||||||
if len(errs) != 0 {
|
if len(errs) != 0 {
|
||||||
t.Errorf("Unexpected error validating %v", errs)
|
t.Errorf("Unexpected error validating %v", errs)
|
||||||
}
|
}
|
||||||
if ttlEnabled != (job.Spec.TTLSecondsAfterFinished != nil) {
|
|
||||||
t.Errorf("Job should allow setting .spec.ttlSecondsAfterFinished only when %v feature is enabled", features.TTLAfterFinished)
|
|
||||||
}
|
|
||||||
if indexedJobEnabled != (job.Spec.CompletionMode != nil) {
|
if indexedJobEnabled != (job.Spec.CompletionMode != nil) {
|
||||||
t.Errorf("Job should allow setting .spec.completionMode only when %v feature is enabled", features.IndexedJob)
|
t.Errorf("Job should allow setting .spec.completionMode only when %v feature is enabled", features.IndexedJob)
|
||||||
}
|
}
|
||||||
@ -191,9 +182,6 @@ func testJobStrategy(t *testing.T) {
|
|||||||
if updatedJob.Generation != 2 {
|
if updatedJob.Generation != 2 {
|
||||||
t.Errorf("expected Generation=2, got %d", updatedJob.Generation)
|
t.Errorf("expected Generation=2, got %d", updatedJob.Generation)
|
||||||
}
|
}
|
||||||
if ttlEnabled != (updatedJob.Spec.TTLSecondsAfterFinished != nil) {
|
|
||||||
t.Errorf("Job should only allow updating .spec.ttlSecondsAfterFinished when %v feature is enabled", features.TTLAfterFinished)
|
|
||||||
}
|
|
||||||
wantAnnotations = make(map[string]string)
|
wantAnnotations = make(map[string]string)
|
||||||
if trackingWithFinalizersEnabled {
|
if trackingWithFinalizersEnabled {
|
||||||
wantAnnotations[batchv1.JobTrackingFinalizer] = ""
|
wantAnnotations[batchv1.JobTrackingFinalizer] = ""
|
||||||
|
@ -392,15 +392,13 @@ func buildControllerRoles() ([]rbacv1.ClusterRole, []rbacv1.ClusterRoleBinding)
|
|||||||
eventsRule(),
|
eventsRule(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.TTLAfterFinished) {
|
addControllerRole(&controllerRoles, &controllerRoleBindings, rbacv1.ClusterRole{
|
||||||
addControllerRole(&controllerRoles, &controllerRoleBindings, rbacv1.ClusterRole{
|
ObjectMeta: metav1.ObjectMeta{Name: saRolePrefix + "ttl-after-finished-controller"},
|
||||||
ObjectMeta: metav1.ObjectMeta{Name: saRolePrefix + "ttl-after-finished-controller"},
|
Rules: []rbacv1.PolicyRule{
|
||||||
Rules: []rbacv1.PolicyRule{
|
rbacv1helpers.NewRule("get", "list", "watch", "delete").Groups(batchGroup).Resources("jobs").RuleOrDie(),
|
||||||
rbacv1helpers.NewRule("get", "list", "watch", "delete").Groups(batchGroup).Resources("jobs").RuleOrDie(),
|
eventsRule(),
|
||||||
eventsRule(),
|
},
|
||||||
},
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
addControllerRole(&controllerRoles, &controllerRoleBindings, rbacv1.ClusterRole{
|
addControllerRole(&controllerRoles, &controllerRoleBindings, rbacv1.ClusterRole{
|
||||||
ObjectMeta: metav1.ObjectMeta{Name: saRolePrefix + "root-ca-cert-publisher"},
|
ObjectMeta: metav1.ObjectMeta{Name: saRolePrefix + "root-ca-cert-publisher"},
|
||||||
Rules: []rbacv1.PolicyRule{
|
Rules: []rbacv1.PolicyRule{
|
||||||
|
@ -227,8 +227,6 @@ message JobSpec {
|
|||||||
// guarantees (e.g. finalizers) will be honored. If this field is unset,
|
// guarantees (e.g. finalizers) will be honored. If this field is unset,
|
||||||
// the Job won't be automatically deleted. If this field is set to zero,
|
// the Job won't be automatically deleted. If this field is set to zero,
|
||||||
// the Job becomes eligible to be deleted immediately after it finishes.
|
// the Job becomes eligible to be deleted immediately after it finishes.
|
||||||
// This field is alpha-level and is only honored by servers that enable the
|
|
||||||
// TTLAfterFinished feature.
|
|
||||||
// +optional
|
// +optional
|
||||||
optional int32 ttlSecondsAfterFinished = 8;
|
optional int32 ttlSecondsAfterFinished = 8;
|
||||||
|
|
||||||
|
@ -154,8 +154,6 @@ type JobSpec struct {
|
|||||||
// guarantees (e.g. finalizers) will be honored. If this field is unset,
|
// guarantees (e.g. finalizers) will be honored. If this field is unset,
|
||||||
// the Job won't be automatically deleted. If this field is set to zero,
|
// the Job won't be automatically deleted. If this field is set to zero,
|
||||||
// the Job becomes eligible to be deleted immediately after it finishes.
|
// the Job becomes eligible to be deleted immediately after it finishes.
|
||||||
// This field is alpha-level and is only honored by servers that enable the
|
|
||||||
// TTLAfterFinished feature.
|
|
||||||
// +optional
|
// +optional
|
||||||
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty" protobuf:"varint,8,opt,name=ttlSecondsAfterFinished"`
|
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty" protobuf:"varint,8,opt,name=ttlSecondsAfterFinished"`
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ var map_JobSpec = map[string]string{
|
|||||||
"selector": "A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors",
|
"selector": "A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#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: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector",
|
"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: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector",
|
||||||
"template": "Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/",
|
"template": "Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/",
|
||||||
"ttlSecondsAfterFinished": "ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature.",
|
"ttlSecondsAfterFinished": "ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes.",
|
||||||
"completionMode": "CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nThis field is beta-level. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.",
|
"completionMode": "CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nThis field is beta-level. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.",
|
||||||
"suspend": "Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.\n\nThis field is beta-level, gated by SuspendJob feature flag (enabled by default).",
|
"suspend": "Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.\n\nThis field is beta-level, gated by SuspendJob feature flag (enabled by default).",
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ const (
|
|||||||
JobTimeout = 15 * time.Minute
|
JobTimeout = 15 * time.Minute
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("[Feature:TTLAfterFinished]", func() {
|
var _ = SIGDescribe("TTLAfterFinished", func() {
|
||||||
f := framework.NewDefaultFramework("ttlafterfinished")
|
f := framework.NewDefaultFramework("ttlafterfinished")
|
||||||
|
|
||||||
ginkgo.It("job should be deleted once it finishes after TTL seconds", func() {
|
ginkgo.It("job should be deleted once it finishes after TTL seconds", func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user