Skip to content

Commit f66166b

Browse files
committed
ci(ci): add kube-hunter to matrix make build
Signed-off-by: Yannik Fuhrmeister <yannik.fuhrmeister@iteratec.com>
1 parent 8de23fe commit f66166b

4 files changed

Lines changed: 10 additions & 16 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -907,20 +907,6 @@ jobs:
907907
kubectl create deployment --image nginx:alpine nginx --namespace demo-targets
908908
kubectl expose deployment nginx --port 80 --namespace demo-targets
909909
910-
# ---- Kubehunter Integration Tests ----
911-
912-
- name: "kube-hunter Integration Tests"
913-
run: |
914-
helm -n integration-tests install kube-hunter ./scanners/kube-hunter/ \
915-
--set="scanner.image.repository=docker.io/${{ env.DOCKER_NAMESPACE }}/scanner-kube-hunter" \
916-
--set="scanner.image.tag=sha-$(git rev-parse --short HEAD)" \
917-
--set="parser.image.repository=docker.io/${{ env.DOCKER_NAMESPACE }}/parser-kube-hunter" \
918-
--set="parser.image.tag=sha-$(git rev-parse --short HEAD)" \
919-
--set="parser.env[0].name=CRASH_ON_FAILED_VALIDATION" \
920-
--set-string="parser.env[0].value=true"
921-
cd tests/integration/
922-
npx jest --ci --color scanner/kube-hunter.test.js
923-
924910
# ---- Kubeaudit Integration Tests ----
925911

926912
- name: "kubeaudit Integration Tests"

‎scanners/kube-hunter/Makefile‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/make -f
1+
j!/usr/bin/make -f
22
#
33
# SPDX-FileCopyrightText: 2021 iteratec GmbH
44
#
@@ -10,3 +10,10 @@ scanner = kube-hunter
1010
custom_scanner = set
1111

1212
include ../../scanners.mk
13+
14+
integration-tests:
15+
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
16+
kubectl -n integration-tests delete scans --all
17+
cd ../../tests/integration/ && npm ci
18+
cd ../../scanners/${scanner}
19+
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

tests/integration/scanner/kube-hunter.test.js renamed to scanners/kube-hunter/integration-tests/kube-hunter.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// SPDX-License-Identifier: Apache-2.0
44

5-
const { scan } = require("../helpers");
5+
const { scan } = require("../../../tests/integration/helpers");
66

77
jest.retryTimes(3);
88

0 commit comments

Comments
 (0)