diff --git a/.github/workflows/ci-test-ginkgo.yml b/.github/workflows/ci-test-ginkgo.yml index 53bf273d71..52ce137ab1 100644 --- a/.github/workflows/ci-test-ginkgo.yml +++ b/.github/workflows/ci-test-ginkgo.yml @@ -173,12 +173,25 @@ jobs: echo "Pod: $POD_NAME" echo "POD_NAME=$POD_NAME" >> $GITHUB_ENV + sleep 15 + kubectl get pods -A + kubectl describe pod -n nginx + sleep 15 + kubectl logs -n kubearmor deployments/kubearmor-controller + - name: Test KubeArmor using Ginkgo run: | go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo make working-directory: ./tests/k8s_env timeout-minutes: 30 + + - name: check controller nginx logs + if: ${{ failure() }} + run: | + kubectl get pods -n nginx + kubectl logs -n kubearmor deployments/kubearmor-controller + - name: Kill KubeArmor prcoess in the pod run: | diff --git a/tests/k8s_env/Makefile b/tests/k8s_env/Makefile index 8e8a090053..5232b21081 100644 --- a/tests/k8s_env/Makefile +++ b/tests/k8s_env/Makefile @@ -6,7 +6,7 @@ build: @go mod tidy # run in two steps as syscall suite fails if run at the very end # see - https://github.com/kubearmor/KubeArmor/issues/1269 - @ginkgo --vv --flake-attempts=10 --timeout=15m syscalls/ + @ginkgo --vv --flake-attempts=3 --timeout=15m --fail-fast ksp/ @ginkgo -r --vv --flake-attempts=10 --timeout=30m --skip-package "syscalls" .PHONY: test test: diff --git a/tests/k8s_env/ksp/ksp_test.go b/tests/k8s_env/ksp/ksp_test.go index a172fcdfd2..49700c5ce8 100644 --- a/tests/k8s_env/ksp/ksp_test.go +++ b/tests/k8s_env/ksp/ksp_test.go @@ -68,9 +68,10 @@ var _ = Describe("Ksp", func() { fmt.Printf(" No pods with label pre-run-pod-test=true found ") return } - + fmt.Println(len(pods.Items)) for _, item := range pods.Items { annotated := false + fmt.Printf("annotations: %s status= %s , condition: %s", item.Annotations, item.Status.Phase, &item.Status.Conditions) for key, value := range item.Annotations { fmt.Printf("K8sGetPods pod=%s ns=%s Annotation Key=%v value=%s", item.Name, "nginx", key, value) if key == "kubearmor-policy" {