Skip to content

Commit e7233ec

Browse files
jentingroboquat
authored andcommitted
Forbid job to run concurrency
When using concurrentPolicy=Replace and the job failed but haven't reach the backoff limit, the new job will replace the original one if the schedule time is less than the sum of the backoff time. It causes a problem that the job alert `kube_job_status_failed{job_name=~"refresh-credential.*",reason="BackoffLimitExceeded"}` can't be fired. Signed-off-by: JenTing Hsiao <[email protected]>
1 parent 59ba9a4 commit e7233ec

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

install/installer/cmd/testdata/render/aws-setup/output.golden

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install/installer/pkg/components/refresh-credential/cronjob.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ func cronjob(ctx *common.RenderContext) ([]runtime.Object, error) {
6363
Spec: batchv1.CronJobSpec{
6464
Schedule: CronSchedule,
6565
SuccessfulJobsHistoryLimit: pointer.Int32(1),
66-
FailedJobsHistoryLimit: pointer.Int32(10),
67-
ConcurrencyPolicy: batchv1.ReplaceConcurrent,
66+
FailedJobsHistoryLimit: pointer.Int32(1),
67+
ConcurrencyPolicy: batchv1.ForbidConcurrent,
6868
JobTemplate: batchv1.JobTemplateSpec{
6969
ObjectMeta: objectMeta,
7070
Spec: batchv1.JobSpec{

0 commit comments

Comments
 (0)