mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
chore: add autogen internals e2e tests (#3492)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
parent
c59affb248
commit
80d1ccb26d
1 changed files with 89 additions and 0 deletions
89
.github/workflows/e2e-autogen-internals.yaml
vendored
Normal file
89
.github/workflows/e2e-autogen-internals.yaml
vendored
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
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'
|
||||||
|
- 'docs/**'
|
||||||
|
- '.github/config.yml'
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
e2e-test:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
k8s-version: [v1.23.3]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
|
||||||
|
|
||||||
|
- name: Unshallow
|
||||||
|
run: git fetch --prune --unshallow
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 # v2.1.5
|
||||||
|
with:
|
||||||
|
go-version: 1.17
|
||||||
|
|
||||||
|
- name: Set up Helm
|
||||||
|
uses: azure/setup-helm@18bc76811624f360dbd7f18c2d4ecb32c7b87bab # v1.1
|
||||||
|
with:
|
||||||
|
version: v3.5.0
|
||||||
|
|
||||||
|
- name: Set up chart-testing
|
||||||
|
uses: helm/chart-testing-action@b0d4458c71155b54fcf33e11dd465dc923550009 # v2.0.1
|
||||||
|
|
||||||
|
- name: Cache Go modules
|
||||||
|
uses: actions/cache@d9747005de0f7240e5d35a68dca96b3f41b8b340 # v1.2.0
|
||||||
|
with:
|
||||||
|
path: ~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
|
||||||
|
- name : Create dev images, kind cluster and setup kustomize
|
||||||
|
run: |
|
||||||
|
export KIND_IMAGE=kindest/node:${{ matrix.k8s-version }}
|
||||||
|
make create-e2e-infrastruture
|
||||||
|
|
||||||
|
- name: e2e testing
|
||||||
|
run: |
|
||||||
|
echo ">>> Install Kyverno"
|
||||||
|
cat ${GITHUB_WORKSPACE}/config/install.yaml | \
|
||||||
|
sed -e 's/imagePullPolicy:.*$/imagePullPolicy: IfNotPresent/g' | \
|
||||||
|
sed -e 's/--autogenInternals:false$/--autogenInternals:true/g' | \
|
||||||
|
kubectl apply -f -
|
||||||
|
kubectl apply -f ${GITHUB_WORKSPACE}/config/github/rbac.yaml
|
||||||
|
chmod a+x ${GITHUB_WORKSPACE}/scripts/verify-deployment.sh
|
||||||
|
sleep 50
|
||||||
|
echo ">>> Check kyverno"
|
||||||
|
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"
|
||||||
|
export FLAG_AUTOGEN_INTERNALS=true
|
||||||
|
make test-e2e
|
||||||
|
kubectl delete -f ${GITHUB_WORKSPACE}/config/install.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
|
Loading…
Add table
Reference in a new issue