@@ -115,7 +115,6 @@ func (r *ScanReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
115115func (r * ScanReconciler ) getJob (name , namespace string ) (* batch.Job , error ) {
116116 ctx := context .Background ()
117117
118- // check if k8s job for scan was already created
119118 var job batch.Job
120119 err := r .Get (ctx , types.NamespacedName {Name : name , Namespace : namespace }, & job )
121120 if apierrors .IsNotFound (err ) {
@@ -169,12 +168,9 @@ func (r *ScanReconciler) startScan(scan *executionv1.Scan) error {
169168 return nil
170169 }
171170
172- // get the scan template for the scan
171+ // get the ScanType for the scan
173172 var scanType executionv1.ScanType
174173 if err := r .Get (ctx , types.NamespacedName {Name : scan .Spec .ScanType , Namespace : scan .Namespace }, & scanType ); err != nil {
175- // we'll ignore not-found errors, since they can't be fixed by an immediate
176- // requeue (we'll need to wait for a new notification), and we can get them
177- // on deleted requests.
178174 log .V (7 ).Info ("Unable to fetch ScanType" )
179175
180176 scan .Status .State = "Errored"
@@ -205,9 +201,6 @@ func (r *ScanReconciler) startScan(scan *executionv1.Scan) error {
205201 job , err = r .constructJobForScan (scan , & scanType )
206202 if err != nil {
207203 log .Error (err , "unable to create job object ScanType" )
208- // we'll ignore not-found errors, since they can't be fixed by an immediate
209- // requeue (we'll need to wait for a new notification), and we can get them
210- // on deleted requests.
211204 return err
212205 }
213206
0 commit comments