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
6918109b
Commit
6918109b
authored
May 31, 2017
by
zhangxiaoyu-zidif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for-loop and err definition
parent
1fd6e97a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
cronjob_controller.go
pkg/controller/cronjob/cronjob_controller.go
+2
-3
No files found.
pkg/controller/cronjob/cronjob_controller.go
View file @
6918109b
...
...
@@ -205,8 +205,7 @@ func syncOne(sj *batchv2alpha1.CronJob, js []batchv1.Job, now time.Time, jc jobC
nameForLog
:=
fmt
.
Sprintf
(
"%s/%s"
,
sj
.
Namespace
,
sj
.
Name
)
childrenJobs
:=
make
(
map
[
types
.
UID
]
bool
)
for
i
:=
range
js
{
j
:=
js
[
i
]
for
_
,
j
:=
range
js
{
childrenJobs
[
j
.
ObjectMeta
.
UID
]
=
true
found
:=
inActiveList
(
*
sj
,
j
.
ObjectMeta
.
UID
)
if
!
found
&&
!
IsJobFinished
(
&
j
)
{
...
...
@@ -366,11 +365,11 @@ func deleteJob(sj *batchv2alpha1.CronJob, job *batchv1.Job, jc jobControlInterfa
// TODO: this should be replaced with server side job deletion
// currencontinuetly this mimics JobReaper from pkg/kubectl/stop.go
nameForLog
:=
fmt
.
Sprintf
(
"%s/%s"
,
sj
.
Namespace
,
sj
.
Name
)
var
err
error
// scale job down to 0
if
*
job
.
Spec
.
Parallelism
!=
0
{
zero
:=
int32
(
0
)
var
err
error
job
.
Spec
.
Parallelism
=
&
zero
job
,
err
=
jc
.
UpdateJob
(
job
.
Namespace
,
job
)
if
err
!=
nil
{
...
...
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