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
6b2e9e8a
Commit
6b2e9e8a
authored
Mar 26, 2019
by
danielqsj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add completed job status in cronjob event
parent
d24fe8a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
controller.go
pkg/controller/cronjob/controller.go
+3
-3
No files found.
pkg/controller/cronjob/controller.go
View file @
6b2e9e8a
...
@@ -219,7 +219,7 @@ func syncOne(sj *batchv1beta1.CronJob, js []batchv1.Job, now time.Time, jc jobCo
...
@@ -219,7 +219,7 @@ func syncOne(sj *batchv1beta1.CronJob, js []batchv1.Job, now time.Time, jc jobCo
childrenJobs
[
j
.
ObjectMeta
.
UID
]
=
true
childrenJobs
[
j
.
ObjectMeta
.
UID
]
=
true
found
:=
inActiveList
(
*
sj
,
j
.
ObjectMeta
.
UID
)
found
:=
inActiveList
(
*
sj
,
j
.
ObjectMeta
.
UID
)
if
!
found
&&
!
IsJobFinished
(
&
j
)
{
if
!
found
&&
!
IsJobFinished
(
&
j
)
{
recorder
.
Eventf
(
sj
,
v1
.
EventTypeWarning
,
"UnexpectedJob"
,
"Saw a job that the controller did not create or forgot: %
v
"
,
j
.
Name
)
recorder
.
Eventf
(
sj
,
v1
.
EventTypeWarning
,
"UnexpectedJob"
,
"Saw a job that the controller did not create or forgot: %
s
"
,
j
.
Name
)
// We found an unfinished job that has us as the parent, but it is not in our Active list.
// We found an unfinished job that has us as the parent, but it is not in our Active list.
// This could happen if we crashed right after creating the Job and before updating the status,
// This could happen if we crashed right after creating the Job and before updating the status,
// or if our jobs list is newer than our sj status after a relist, or if someone intentionally created
// or if our jobs list is newer than our sj status after a relist, or if someone intentionally created
...
@@ -231,9 +231,9 @@ func syncOne(sj *batchv1beta1.CronJob, js []batchv1.Job, now time.Time, jc jobCo
...
@@ -231,9 +231,9 @@ func syncOne(sj *batchv1beta1.CronJob, js []batchv1.Job, now time.Time, jc jobCo
// in the same namespace "adopt" that job. ReplicaSets and their Pods work the same way.
// in the same namespace "adopt" that job. ReplicaSets and their Pods work the same way.
// TBS: how to update sj.Status.LastScheduleTime if the adopted job is newer than any we knew about?
// TBS: how to update sj.Status.LastScheduleTime if the adopted job is newer than any we knew about?
}
else
if
found
&&
IsJobFinished
(
&
j
)
{
}
else
if
found
&&
IsJobFinished
(
&
j
)
{
_
,
status
:=
getFinishedStatus
(
&
j
)
deleteFromActiveList
(
sj
,
j
.
ObjectMeta
.
UID
)
deleteFromActiveList
(
sj
,
j
.
ObjectMeta
.
UID
)
// TODO: event to call out failure vs success.
recorder
.
Eventf
(
sj
,
v1
.
EventTypeNormal
,
"SawCompletedJob"
,
"Saw completed job: %s, status: %v"
,
j
.
Name
,
status
)
recorder
.
Eventf
(
sj
,
v1
.
EventTypeNormal
,
"SawCompletedJob"
,
"Saw completed job: %v"
,
j
.
Name
)
}
}
}
}
...
...
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