Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 5717873

Browse files
committed
Merge branch 'master' of github.com:secureCodeBox/secureCodeBox-v2-alpha
2 parents bf26206 + f1d0306 commit 5717873

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
go-version: "1.13"
7373
- name: "Lint Lurcher Go Code"
7474
run: |
75-
cd operator/
75+
cd lurcher/
7676
go fmt ./...
7777
go vet ./...
7878
- uses: docker/build-push-action@v1

operator/controllers/execution/scan_controller.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ func (r *ScanReconciler) startParser(scan *executionv1.Scan) error {
315315
}
316316
labels["experimental.securecodebox.io/job-type"] = "parser"
317317
automountServiceAccountToken := true
318+
var backOffLimit int32 = 3
318319
job = &batch.Job{
319320
ObjectMeta: metav1.ObjectMeta{
320321
Annotations: make(map[string]string),
@@ -323,6 +324,7 @@ func (r *ScanReconciler) startParser(scan *executionv1.Scan) error {
323324
Labels: labels,
324325
},
325326
Spec: batch.JobSpec{
327+
BackoffLimit: &backOffLimit,
326328
Template: corev1.PodTemplateSpec{
327329
Spec: corev1.PodSpec{
328330
RestartPolicy: corev1.RestartPolicyNever,
@@ -521,6 +523,7 @@ func (r *ScanReconciler) constructJobForScan(scan *executionv1.Scan, scanType *e
521523
{
522524
Name: "scan-results",
523525
MountPath: "/home/securecodebox/",
526+
ReadOnly: true,
524527
},
525528
},
526529
}
@@ -556,7 +559,6 @@ func (r *ScanReconciler) PresignedGetURL(scanID types.UID, filename string) (str
556559
return rawResultDownloadURL.String(), nil
557560
}
558561

559-
// PresignedGetURL returns a presigned URL from the s3 (or compatible) serice.
560562
func (r *ScanReconciler) startPersistenceProvider(scan *executionv1.Scan) error {
561563
ctx := context.Background()
562564

@@ -670,20 +672,16 @@ func (r *ScanReconciler) startPersistenceProvider(scan *executionv1.Scan) error
670672
}
671673

672674
func allJobsCompleted(jobs *batch.JobList) jobCompletionType {
673-
hasFailed := false
674675
hasCompleted := true
675676

676677
for _, job := range jobs.Items {
677678
if job.Status.Failed > 0 {
678-
hasFailed = true
679+
return failed
679680
} else if job.Status.Succeeded == 0 {
680681
hasCompleted = false
681682
}
682683
}
683684

684-
if hasFailed {
685-
return failed
686-
}
687685
if hasCompleted {
688686
return completed
689687
}

0 commit comments

Comments
 (0)