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

Commit 917763c

Browse files
committed
#33 Use actual namespace when starting the scans
1 parent d3f24d5 commit 917763c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hooks/declarative-subsequent-scans/scan-helpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ kc.loadFromDefault();
66

77
const k8sApiCRD = kc.makeApiClient(k8s.CustomObjectsApi);
88

9+
const namespace = process.env["NAMESPACE"];
10+
911
export async function startSubsequentSecureCodeBoxScan({
1012
name,
1113
parentScan,
@@ -57,12 +59,11 @@ export async function startSubsequentSecureCodeBoxScan({
5759
console.log(`Starting Scan ${name}`);
5860

5961
try {
60-
// Starting another subsequent sslyze scan based on the nmap results
61-
// found at: https://github.com/kubernetes-client/javascript/blob/79736b9a608c18d818de61a6b44503a08ea3a78f/src/gen/api/customObjectsApi.ts#L209
62+
// Submitting the Scan to the kubernetes api
6263
await k8sApiCRD.createNamespacedCustomObject(
6364
"execution.experimental.securecodebox.io",
6465
"v1",
65-
"default",
66+
namespace,
6667
"scans",
6768
scanDefinition,
6869
"false"
@@ -75,7 +76,6 @@ export async function startSubsequentSecureCodeBoxScan({
7576

7677
export async function getCascadingRulesFromCluster() {
7778
try {
78-
const namespace = process.env["NAMESPACE"];
7979
const response: any = await k8sApiCRD.listNamespacedCustomObject(
8080
"cascading.experimental.securecodebox.io",
8181
"v1",

0 commit comments

Comments
 (0)