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

Commit 06e0b15

Browse files
committed
WIP ReadAndWriteHookProcessing
1 parent 186744d commit 06e0b15

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

operator/controllers/execution/scan_controller.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,24 @@ func (r *ScanReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
151151
return ctrl.Result{}, err
152152
}
153153
case "ReadAndWriteHookProcessing":
154-
// Hook Status Array durchgegen
154+
// First Array entry which is not Completed.
155+
var nonCompletedHook *executionv1.HookStatus
156+
157+
for _, hook := range scan.Status.ReadAndWriteHookStatus {
158+
if hook.State != executionv1.Completed {
159+
nonCompletedHook = &hook
160+
break
161+
}
162+
}
163+
164+
if nonCompletedHook == nil {
165+
scan.Status.State = "ReadAndWriteHookCompleted"
166+
if err := r.Status().Update(ctx, &scan); err != nil {
167+
r.Log.Error(err, "unable to update Scan status")
168+
return ctrl.Result{}, err
169+
}
170+
return ctrl.Result{}, nil
171+
}
155172

156173
// hook := First Array entry which is not Completed.
157174

0 commit comments

Comments
 (0)