mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
Signed-off-by: ShutingZhao <shuting@nirmata.com> Signed-off-by: ShutingZhao <shuting@nirmata.com>
91 lines
3.2 KiB
YAML
91 lines
3.2 KiB
YAML
name: e2e-autogen-internals
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
- 'release*'
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- 'docs/**'
|
|
- '.github/config.yml'
|
|
pull_request:
|
|
branches:
|
|
- 'main'
|
|
- 'release*'
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- '.github/config.yml'
|
|
|
|
permissions: read-all
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
e2e-test:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
k8s-version: [v1.22.13, v1.23.10, v1.24.4, v1.25.0]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
|
- name: Unshallow
|
|
run: git fetch --prune --unshallow
|
|
- name: Set up Go
|
|
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
|
with:
|
|
go-version: ~1.19.4
|
|
- name: Set up Helm
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
|
with:
|
|
version: v3.5.0
|
|
- name: Set up chart-testing
|
|
uses: helm/chart-testing-action@afea100a513515fbd68b0e72a7bb0ae34cb62aec # v2.3.1
|
|
- name: Cache Go modules
|
|
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # pin@v3
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
- name: Create kind cluster
|
|
run: |
|
|
export KIND_IMAGE=kindest/node:${{ matrix.k8s-version }}
|
|
make kind-create-cluster
|
|
- name: Build and load dev images in kind cluster
|
|
run: make kind-load-all
|
|
- name: Run e2e tests
|
|
run: |
|
|
echo ">>> Install Kyverno"
|
|
make codegen-manifest-e2e
|
|
cat ${GITHUB_WORKSPACE}/.manifest/e2e.yaml \
|
|
| sed -e 's/imagePullPolicy:.*$/imagePullPolicy: IfNotPresent/g' \
|
|
| kubectl apply --server-side -f -
|
|
kubectl apply -f ${GITHUB_WORKSPACE}/config/e2e/rbac.yaml
|
|
echo ">>> Check kyverno"
|
|
chmod a+x ${GITHUB_WORKSPACE}/scripts/verify-deployment.sh
|
|
sleep 50
|
|
kubectl get pods -n kyverno
|
|
${GITHUB_WORKSPACE}/scripts/verify-deployment.sh -n kyverno kyverno
|
|
sleep 20
|
|
echo ">>> Expose the Kyverno's service's metric server to the host"
|
|
kubectl port-forward svc/kyverno-svc-metrics -n kyverno 8000:8000 &
|
|
echo ">>> Run Kyverno e2e test"
|
|
make test-e2e
|
|
echo ">>> Cleanup"
|
|
kubectl delete -f ${GITHUB_WORKSPACE}/.manifest/e2e.yaml
|
|
- 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
|