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

Commit 116510a

Browse files
committed
#29 Ensure that the RW Hook wasn't started before starting
1 parent c74012a commit 116510a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

operator/controllers/execution/scan_controller.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,18 @@ func (r *ScanReconciler) executeReadAndWriteHooks(scan *executionv1.Scan) error
11351135
return err
11361136
}
11371137

1138+
jobs, err := r.getJobsForScan(scan, client.MatchingLabels{
1139+
"experimental.securecodebox.io/job-type": "read-and-write-hook",
1140+
"experimental.securecodebox.io/hook-name": nonCompletedHook.HookName,
1141+
})
1142+
if err != nil {
1143+
return err
1144+
}
1145+
if len(jobs.Items) > 0 {
1146+
// Job already exists
1147+
return nil
1148+
}
1149+
11381150
jobName, err := r.createJobForHook(
11391151
&hook,
11401152
scan,

0 commit comments

Comments
 (0)