-
Notifications
You must be signed in to change notification settings - Fork 349
62 lines (53 loc) · 1.97 KB
/
ci-test-controllers.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: ci-test-controllers
on:
pull_request:
branches:
- "main"
paths:
- "pkg/**"
- ".github/workflows/ci-test-controllers.yml"
jobs:
kubearmor-controller-test:
name: Build and Test KubeArmorController Using Ginkgo
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/setup-go@v3
with:
go-version: "v1.20"
- uses: actions/checkout@v3
- name: Setup a Kubernetes environment
run: ./.github/workflows/install-k3s.sh
- name: Build KubeArmorController
run: make -C pkg/KubeArmorController/ docker-build TAG=latest
- name: Install KubeArmor Latest and KubeArmorController using Helm
run: |
# install kubearmor latest and controller built in this PR
helm upgrade --install kubearmor ./deployments/helm/KubeArmor \
--values ./KubeArmor/build/kubearmor-helm-test-values.yaml \
--set kubearmorController.imagePullPolicy=Never \
--set kubearmorInit.imagePullPolicy=Always \
--set kubearmor.imagePullPolicy=Always \
--set kubearmor.image.tag=latest \
-n kubearmor --create-namespace;
kubectl wait --for=condition=ready --timeout=5m -n kubearmor pod -l kubearmor-app
kubectl get pods -A
- name: Test KubeArmor using Ginkgo
run: |
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
make -C tests/k8s_env/
timeout-minutes: 20
- name: Get karmor sysdump
if: ${{ failure() }}
run: |
kubectl describe pod -n kubearmor -l kubearmor-app=kubearmor
curl -sfL http://get.kubearmor.io/ | sudo sh -s -- -b /usr/local/bin
mkdir -p /tmp/kubearmor/ && cd /tmp/kubearmor && karmor sysdump
- name: Archive log artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: kubearmor.logs
path: |
/tmp/kubearmor/
/tmp/kubearmor.*