Skip to content

Commit

Permalink
Merge branch 'rhtapbugs824' of github.com:johnmcollier/application-se…
Browse files Browse the repository at this point in the history
…rvice into rhtapbugs824

Signed-off-by: John Collier <jcollier@redhat.com>
  • Loading branch information
johnmcollier committed Nov 7, 2023
2 parents 9ae99a8 + fc7583b commit db1bdcb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions controllers/componentdetectionquery_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ func (r *ComponentDetectionQueryReconciler) Reconcile(ctx context.Context, req c
}

cm, err := waitForConfigMap(clientset, ctx, req.Name, req.Namespace)
if err != nil {
if err != nil || cm == nil {
if cm == nil {
err = fmt.Errorf("failed to wait for configmap creation, configmap is nil")
}
log.Error(err, fmt.Sprintf("Error waiting for configmap creation ...%v", req.NamespacedName))
r.SetCompleteConditionAndUpdateCR(ctx, req, &componentDetectionQuery, copiedCDQ, err)
cleanupK8sResources(log, clientset, ctx, fmt.Sprintf("%s-job", req.Name), req.Name, req.Namespace)
Expand Down Expand Up @@ -510,7 +513,7 @@ func waitForConfigMap(clientset *kubernetes.Clientset, ctx context.Context, name
return configMap, nil

case <-ctx.Done():
return nil, nil
return nil, fmt.Errorf("context done while waiting for configmap creation, the context might be cancelled or exceeded")

Check warning on line 516 in controllers/componentdetectionquery_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/componentdetectionquery_controller.go#L515-L516

Added lines #L515 - L516 were not covered by tests
}
}
}
Expand Down

0 comments on commit db1bdcb

Please sign in to comment.