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
e6964fa2
Commit
e6964fa2
authored
Apr 29, 2016
by
Maciej Szulik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ScheduledJob api types
parent
ef885d05
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
152 additions
and
0 deletions
+152
-0
types.go
pkg/apis/batch/types.go
+76
-0
types.go
pkg/apis/batch/v2alpha1/types.go
+76
-0
No files found.
pkg/apis/batch/types.go
View file @
e6964fa2
...
...
@@ -164,3 +164,79 @@ type JobCondition struct {
// Human readable message indicating details about last transition.
Message
string
`json:"message,omitempty"`
}
// ScheduledJob represents the configuration of a single scheduled job.
type
ScheduledJob
struct
{
unversioned
.
TypeMeta
`json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
api
.
ObjectMeta
`json:"metadata,omitempty"`
// Spec is a structure defining the expected behavior of a job, including the schedule.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
Spec
ScheduledJobSpec
`json:"spec,omitempty"`
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
Status
ScheduledJobStatus
`json:"status,omitempty"`
}
// ScheduledJobList is a collection of scheduled jobs.
type
ScheduledJobList
struct
{
unversioned
.
TypeMeta
`json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
unversioned
.
ListMeta
`json:"metadata,omitempty"`
// Items is the list of ScheduledJob.
Items
[]
ScheduledJob
`json:"items"`
}
// ScheduledJobSpec describes how the job execution will look like and when it will actually run.
type
ScheduledJobSpec
struct
{
// Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
Schedule
string
`json:"schedule"`
// Optional deadline in seconds for starting the job if it misses scheduled
// time for any reason. Missed jobs executions will be counted as failed ones.
StartingDeadlineSeconds
*
int64
`json:"startingDeadlineSeconds,omitempty"`
// ConcurrencyPolicy specifies how to treat concurrent executions of a Job.
ConcurrencyPolicy
ConcurrencyPolicy
`json:"concurrencyPolicy,omitempty"`
// Suspend flag tells the controller to suspend subsequent executions, it does
// not apply to already started executions. Defaults to false.
Suspend
bool
`json:"suspend"`
// JobTemplate is the object that describes the job that will be created when
// executing a ScheduledJob.
JobTemplate
JobTemplateSpec
`json:"jobTemplate"`
}
// ConcurrencyPolicy describes how the job will be handled.
// Only one of the following concurrent policies may be specified.
// If none of the following policies is specified, the default one
// is AllowConcurrent.
type
ConcurrencyPolicy
string
const
(
// AllowConcurrent allows ScheduledJobs to run concurrently.
AllowConcurrent
ConcurrencyPolicy
=
"Allow"
// ForbidConcurrent forbids concurrent runs, skipping next run if previous
// hasn't finished yet.
ForbidConcurrent
ConcurrencyPolicy
=
"Forbid"
// ReplaceConcurrent cancels currently running job and replaces it with a new one.
ReplaceConcurrent
ConcurrencyPolicy
=
"Replace"
)
// ScheduledJobStatus represents the current state of a Job.
type
ScheduledJobStatus
struct
{
// Active holds pointers to currently running jobs.
Active
[]
api
.
ObjectReference
`json:"active,omitempty"`
// LastScheduleTime keeps information of when was the last time the job was successfully scheduled.
LastScheduleTime
*
unversioned
.
Time
`json:"lastScheduleTime,omitempty"`
}
pkg/apis/batch/v2alpha1/types.go
View file @
e6964fa2
...
...
@@ -169,6 +169,82 @@ type JobCondition struct {
Message
string
`json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
}
// ScheduledJob represents the configuration of a single scheduled job.
type
ScheduledJob
struct
{
unversioned
.
TypeMeta
`json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
v1
.
ObjectMeta
`json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec is a structure defining the expected behavior of a job, including the schedule.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
Spec
ScheduledJobSpec
`json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
Status
ScheduledJobStatus
`json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
// ScheduledJobList is a collection of scheduled jobs.
type
ScheduledJobList
struct
{
unversioned
.
TypeMeta
`json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
unversioned
.
ListMeta
`json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of ScheduledJob.
Items
[]
ScheduledJob
`json:"items" protobuf:"bytes,2,rep,name=items"`
}
// ScheduledJobSpec describes how the job execution will look like and when it will actually run.
type
ScheduledJobSpec
struct
{
// Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
Schedule
string
`json:"schedule" protobuf:"bytes,1,opt,name=schedule"`
// Optional deadline in seconds for starting the job if it misses scheduled
// time for any reason. Missed jobs executions will be counted as failed ones.
StartingDeadlineSeconds
*
int64
`json:"startingDeadlineSeconds,omitempty" protobuf:"varint,2,opt,name=startingDeadlineSeconds"`
// ConcurrencyPolicy specifies how to treat concurrent executions of a Job.
ConcurrencyPolicy
ConcurrencyPolicy
`json:"concurrencyPolicy,omitempty" protobuf:"bytes,3,opt,name=concurrencyPolicy,casttype=ConcurrencyPolicy"`
// Suspend flag tells the controller to suspend subsequent executions, it does
// not apply to already started executions. Defaults to false.
Suspend
bool
`json:"suspend" protobuf:"varint,4,opt,name=suspend"`
// JobTemplate is the object that describes the job that will be created when
// executing a ScheduledJob.
JobTemplate
*
JobTemplateSpec
`json:"jobTemplate" protobuf:"bytes,5,opt,name=jobTemplate"`
}
// ConcurrencyPolicy describes how the job will be handled.
// Only one of the following concurrent policies may be specified.
// If none of the following policies is specified, the default one
// is AllowConcurrent.
type
ConcurrencyPolicy
string
const
(
// AllowConcurrent allows ScheduledJobs to run concurrently.
AllowConcurrent
ConcurrencyPolicy
=
"Allow"
// ForbidConcurrent forbids concurrent runs, skipping next run if previous
// hasn't finished yet.
ForbidConcurrent
ConcurrencyPolicy
=
"Forbid"
// ReplaceConcurrent cancels currently running job and replaces it with a new one.
ReplaceConcurrent
ConcurrencyPolicy
=
"Replace"
)
// ScheduledJobStatus represents the current state of a Job.
type
ScheduledJobStatus
struct
{
// Active holds pointers to currently running jobs.
Active
[]
v1
.
ObjectReference
`json:"active,omitempty" protobuf:"bytes,1,rep,name=active"`
// LastScheduleTime keeps information of when was the last time the job was successfully scheduled.
LastScheduleTime
*
unversioned
.
Time
`json:"lastScheduleTime,omitempty" protobuf:"bytes,4,opt,name=lastScheduleTime"`
}
// A label selector is a label query over a set of resources. The result of matchLabels and
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
...
...
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