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

Commit 8d0c7d0

Browse files
committed
Fix bug which lead scans to be marked as done when the ReadOnly hooks are still running
ReadOnly Hooks were labeled as ReadAndWrite when started which lead them to not be found later
1 parent 2c22df5 commit 8d0c7d0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

operator/controllers/execution/scan_controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,11 @@ func (r *ScanReconciler) createJobForHook(hook *executionv1.ScanCompletionHook,
10131013
if labels == nil {
10141014
labels = make(map[string]string)
10151015
}
1016-
labels["experimental.securecodebox.io/job-type"] = "read-and-write-hook"
1016+
if hook.Spec.Type == executionv1.ReadAndWrite {
1017+
labels["experimental.securecodebox.io/job-type"] = "read-and-write-hook"
1018+
} else if hook.Spec.Type == executionv1.ReadOnly {
1019+
labels["experimental.securecodebox.io/job-type"] = "read-only-hook"
1020+
}
10171021
var backOffLimit int32 = 3
10181022
job := &batch.Job{
10191023
ObjectMeta: metav1.ObjectMeta{

0 commit comments

Comments
 (0)