Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion operator/controllers/execution/scans/scan_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (r *ScanReconciler) startScan(scan *executionv1.Scan) error {
log.V(7).Info("Unable to fetch ScanType")

scan.Status.State = "Errored"
scan.Status.ErrorDescription = fmt.Sprintf("Configured ScanType '%s' not found in Scans Namespace. You'll likely need to deploy the ScanType.", scan.Spec.ScanType)
scan.Status.ErrorDescription = fmt.Sprintf("Configured ScanType '%s' not found in '%s' namespace. You'll likely need to deploy the ScanType.", scan.Spec.ScanType, scan.Namespace)
if err := r.Status().Update(ctx, scan); err != nil {
r.Log.Error(err, "unable to update Scan status")
return err
Expand Down
23 changes: 11 additions & 12 deletions tests/integration/generic/no-scan-definition-error.test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const { scan } = require('../helpers')
const { scan } = require("../helpers");

test(
"scan without a matching ScanType should be marked as errored",
async () => {
await expect(scan(
"scan-type-not-found",
"this-type-does-not-exists",
[],
30
)).rejects.toThrow(`Scan failed with description "Configured ScanType 'this-type-does-not-exists' not found in Scans Namespace. You'll likely need to deploy the ScanType."`);
},
1 * 60 * 1000
);
"scan without a matching ScanType should be marked as errored",
async () => {
await expect(
scan("scan-type-not-found", "this-type-does-not-exists", [], 30)
).rejects.toThrow(
`Scan failed with description "Configured ScanType 'this-type-does-not-exists' not found in 'integration-tests' namespace. You'll likely need to deploy the ScanType."`
);
},
1 * 60 * 1000
);