Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
209b3268
Commit
209b3268
authored
Jul 24, 2018
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add TTLAfterFinished alpha feature
parent
92ad24cc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
0 deletions
+33
-0
types.go
pkg/apis/batch/types.go
+12
-0
conversion.go
pkg/apis/batch/v1/conversion.go
+2
-0
kube_features.go
pkg/features/kube_features.go
+7
-0
types.go
staging/src/k8s.io/api/batch/v1/types.go
+12
-0
No files found.
pkg/apis/batch/types.go
View file @
209b3268
...
...
@@ -138,6 +138,18 @@ type JobSpec struct {
// Describes the pod that will be created when executing a job.
Template
api
.
PodTemplateSpec
// 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.
// +optional
TTLSecondsAfterFinished
*
int32
}
// JobStatus represents the current state of a Job.
...
...
pkg/apis/batch/v1/conversion.go
View file @
209b3268
...
...
@@ -54,6 +54,7 @@ func Convert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *batchv1.JobSpec
out
.
Completions
=
in
.
Completions
out
.
ActiveDeadlineSeconds
=
in
.
ActiveDeadlineSeconds
out
.
BackoffLimit
=
in
.
BackoffLimit
out
.
TTLSecondsAfterFinished
=
in
.
TTLSecondsAfterFinished
out
.
Selector
=
in
.
Selector
if
in
.
ManualSelector
!=
nil
{
out
.
ManualSelector
=
new
(
bool
)
...
...
@@ -73,6 +74,7 @@ func Convert_v1_JobSpec_To_batch_JobSpec(in *batchv1.JobSpec, out *batch.JobSpec
out
.
Completions
=
in
.
Completions
out
.
ActiveDeadlineSeconds
=
in
.
ActiveDeadlineSeconds
out
.
BackoffLimit
=
in
.
BackoffLimit
out
.
TTLSecondsAfterFinished
=
in
.
TTLSecondsAfterFinished
out
.
Selector
=
in
.
Selector
if
in
.
ManualSelector
!=
nil
{
out
.
ManualSelector
=
new
(
bool
)
...
...
pkg/features/kube_features.go
View file @
209b3268
...
...
@@ -381,6 +381,12 @@ const (
//
// Enables control over ProcMountType for containers.
ProcMountType
utilfeature
.
Feature
=
"ProcMountType"
// owner: @janetkuo
// alpha: v1.12
//
// Allow TTL controller to clean up Pods and Jobs after they finish.
TTLAfterFinished
utilfeature
.
Feature
=
"TTLAfterFinished"
)
func
init
()
{
...
...
@@ -445,6 +451,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
SCTPSupport
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
VolumeSnapshotDataSource
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ProcMountType
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
TTLAfterFinished
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
// inherited features from generic apiserver, relisted here to get a conflict if it is changed
// unintentionally on either side:
...
...
staging/src/k8s.io/api/batch/v1/types.go
View file @
209b3268
...
...
@@ -114,6 +114,18 @@ type JobSpec struct {
// 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
v1
.
PodTemplateSpec
`json:"template" protobuf:"bytes,6,opt,name=template"`
// 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.
// +optional
TTLSecondsAfterFinished
*
int32
`json:"ttlSecondsAfterFinished,omitempty"`
}
// JobStatus represents the current state of a Job.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment