diff --git a/.github/actions/kyverno-logs/action.yaml b/.github/actions/kyverno-logs/action.yaml new file mode 100644 index 0000000000..f03b4a5827 --- /dev/null +++ b/.github/actions/kyverno-logs/action.yaml @@ -0,0 +1,23 @@ +name: Kyverno logs + +description: Show kyverno pods logs + +runs: + using: composite + steps: + - shell: bash + run: | + kubectl get mutatingwebhookconfigurations + kubectl get validatingwebhookconfigurations + - shell: bash + run: | + kubectl -n kyverno get pod + kubectl -n kyverno describe pod | grep -i events -A10 + - shell: bash + run: | + kubectl -n kyverno logs deploy/kyverno --all-containers -p || true + kubectl -n kyverno logs deploy/kyverno-cleanup-controller --all-containers -p || true + - shell: bash + run: | + kubectl -n kyverno logs deploy/kyverno --all-containers + kubectl -n kyverno logs deploy/kyverno-cleanup-controller --all-containers diff --git a/.github/actions/kyverno-wait-ready/action.yaml b/.github/actions/kyverno-wait-ready/action.yaml new file mode 100644 index 0000000000..0cbe8bce68 --- /dev/null +++ b/.github/actions/kyverno-wait-ready/action.yaml @@ -0,0 +1,10 @@ +name: Kyverno pods ready + +description: Wait kyverno pods are ready + +runs: + using: composite + steps: + - shell: bash + run: | + kubectl wait --namespace kyverno --for=condition=ready pod --all --timeout=60s diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index ed2904b487..08aeea56d1 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -26,21 +26,15 @@ jobs: uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 with: go-version: ~1.19.4 + cache: true - name: Prepare environment run: | export KIND_IMAGE=kindest/node:${{ matrix.k8s-version }} make kind-create-cluster kind-deploy-kyverno - name: Wait for Kyverno to start - run: sleep 60 + uses: ./.github/actions/kyverno-wait-ready - name: Test with kuttl run: make test-kuttl - name: Debug failure if: failure() - run: | - kubectl get mutatingwebhookconfigurations,validatingwebhookconfigurations - kubectl -n kyverno get pod - kubectl -n kyverno describe pod | grep -i events -A10 - kubectl -n kyverno logs deploy/kyverno --all-containers -p || true - kubectl -n kyverno logs deploy/kyverno --all-containers - kubectl -n kyverno logs deploy/kyverno-cleanup-controller --all-containers -p || true - kubectl -n kyverno logs deploy/kyverno-cleanup-controller --all-containers + uses: ./.github/actions/kyverno-logs diff --git a/Makefile b/Makefile index abe34a924a..617b142b22 100644 --- a/Makefile +++ b/Makefile @@ -719,8 +719,6 @@ kind-deploy-kyverno: $(HELM) kind-load-all ## Build images, load them in kind cl --set initImage.repository=$(LOCAL_KYVERNOPRE_IMAGE) \ --set initImage.tag=$(IMAGE_TAG_DEV) \ --values ./scripts/config/$(USE_CONFIG)/kyverno.yaml - @echo Restart kyverno pods... >&2 - @kubectl rollout restart deployment -n kyverno .PHONY: kind-deploy-kyverno-policies kind-deploy-kyverno-policies: $(HELM) ## Deploy kyverno-policies helm chart