Skip to content

Commit

Permalink
revert: "fix: never retry scan job (#194)" (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgb authored Mar 24, 2023
1 parent eb04b06 commit 2fb270a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
name: echo-6bdfc76c56-8ae43-738e6
spec:
activeDeadlineSeconds: 3600 # 1 hour
backoffLimit: 0
backoffLimit: 3
completionMode: NonIndexed
completions: 1
parallelism: 1
Expand Down Expand Up @@ -117,7 +117,7 @@ spec:
volumeMounts:
- mountPath: /var/run/image-scanner
name: image-scanner
restartPolicy: Never
restartPolicy: OnFailure
schedulerName: default-scheduler
securityContext: {}
serviceAccount: image-scanner
Expand Down
4 changes: 2 additions & 2 deletions internal/trivy/scan_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (f *filesystemScanJobBuilder) newImageScanJob(spec stasv1alpha1.ContainerIm
job.Spec.Parallelism = pointer.Int32(1)
job.Spec.Completions = pointer.Int32(1)
job.Spec.ActiveDeadlineSeconds = pointer.Int64(int64(3600))
job.Spec.BackoffLimit = pointer.Int32(0)
job.Spec.BackoffLimit = pointer.Int32(3)
job.Spec.TTLSecondsAfterFinished = pointer.Int32(7200)
job.Spec.Template.Spec.ServiceAccountName = f.ScanJobServiceAccount

Expand All @@ -169,7 +169,7 @@ func (f *filesystemScanJobBuilder) newImageScanJob(spec stasv1alpha1.ContainerIm
}

job.Spec.Template.Spec.AutomountServiceAccountToken = pointer.Bool(false)
job.Spec.Template.Spec.RestartPolicy = corev1.RestartPolicyNever
job.Spec.Template.Spec.RestartPolicy = corev1.RestartPolicyOnFailure

return job, nil
}
Expand Down

0 comments on commit 2fb270a

Please sign in to comment.