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

Commit 37c17c7

Browse files
authored
Merge pull request #91 from secureCodeBox/fix/include-namespace-in-error-message
Include actual namespace in error message
2 parents f7db280 + 5a174f4 commit 37c17c7

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

operator/controllers/execution/scans/scan_reconciler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (r *ScanReconciler) startScan(scan *executionv1.Scan) error {
5050
log.V(7).Info("Unable to fetch ScanType")
5151

5252
scan.Status.State = "Errored"
53-
scan.Status.ErrorDescription = fmt.Sprintf("Configured ScanType '%s' not found in Scans Namespace. You'll likely need to deploy the ScanType.", scan.Spec.ScanType)
53+
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)
5454
if err := r.Status().Update(ctx, scan); err != nil {
5555
r.Log.Error(err, "unable to update Scan status")
5656
return err
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
const { scan } = require('../helpers')
1+
const { scan } = require("../helpers");
22

33
test(
4-
"scan without a matching ScanType should be marked as errored",
5-
async () => {
6-
await expect(scan(
7-
"scan-type-not-found",
8-
"this-type-does-not-exists",
9-
[],
10-
30
11-
)).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."`);
12-
},
13-
1 * 60 * 1000
14-
);
4+
"scan without a matching ScanType should be marked as errored",
5+
async () => {
6+
await expect(
7+
scan("scan-type-not-found", "this-type-does-not-exists", [], 30)
8+
).rejects.toThrow(
9+
`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."`
10+
);
11+
},
12+
1 * 60 * 1000
13+
);

0 commit comments

Comments
 (0)