mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
13caaed8b7
* add image verification * inline policy list Signed-off-by: Jim Bugwadia <jim@nirmata.com> * cosign version and dependencies updates Signed-off-by: Jim Bugwadia <jim@nirmata.com> * add registry initialization Signed-off-by: Jim Bugwadia <jim@nirmata.com> * add build tag to exclude k8schain for cloud providers Signed-off-by: Jim Bugwadia <jim@nirmata.com> * add build tag to exclude k8schain for cloud providers Signed-off-by: Jim Bugwadia <jim@nirmata.com> * generate deep copy and other fixtures Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix deep copy issues Signed-off-by: Jim Bugwadia <jim@nirmata.com> * mutate images to add digest Signed-off-by: Jim Bugwadia <jim@nirmata.com> * add certificates to Kyverno container for HTTPS lookups Signed-off-by: Jim Bugwadia <jim@nirmata.com> * align flag syntax Signed-off-by: Jim Bugwadia <jim@nirmata.com> * update docs Signed-off-by: Jim Bugwadia <jim@nirmata.com> * update dependencies Signed-off-by: Jim Bugwadia <jim@nirmata.com> * update dependencies Signed-off-by: Jim Bugwadia <jim@nirmata.com> * patch image with digest and fix checks Signed-off-by: Jim Bugwadia <jim@nirmata.com> * hardcode image for demos Signed-off-by: Jim Bugwadia <jim@nirmata.com> * add default registry (docker.io) before calling reference.Parse Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix definition Signed-off-by: Jim Bugwadia <jim@nirmata.com> * increase webhook timeout Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix args Signed-off-by: Jim Bugwadia <jim@nirmata.com> * run gofmt Signed-off-by: Jim Bugwadia <jim@nirmata.com> * rename for clarity Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix HasImageVerify check Signed-off-by: Jim Bugwadia <jim@nirmata.com> * align make test commands Signed-off-by: Jim Bugwadia <jim@nirmata.com> * align make test commands Signed-off-by: Jim Bugwadia <jim@nirmata.com> * align make test commands Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix linter error Signed-off-by: Jim Bugwadia <jim@nirmata.com> * format Signed-off-by: Jim Bugwadia <jim@nirmata.com> * handle API conflict and retry Signed-off-by: Jim Bugwadia <jim@nirmata.com> * format Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix reviewdog issues Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix make for unit tests Signed-off-by: Jim Bugwadia <jim@nirmata.com> * improve error message Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix durations Signed-off-by: Jim Bugwadia <jim@nirmata.com> * handle errors in tests Signed-off-by: Jim Bugwadia <jim@nirmata.com> * print policy name Signed-off-by: Jim Bugwadia <jim@nirmata.com> * update tests Signed-off-by: Jim Bugwadia <jim@nirmata.com> * add retries and duration to error log Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix time check in tests Signed-off-by: Jim Bugwadia <jim@nirmata.com> * round creation times in test Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix retry loop Signed-off-by: Jim Bugwadia <jim@nirmata.com> * remove timing check for policy creation Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix e2e error - policy not found Signed-off-by: Shuting Zhao <shutting06@gmail.com> * update string comparison method Signed-off-by: Shuting Zhao <shutting06@gmail.com> * fix test Generate_Namespace_Label_Actions Signed-off-by: Shuting Zhao <shutting06@gmail.com> * add debug info for e2e tests Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix error Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix generate bug Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix format Signed-off-by: Jim Bugwadia <jim@nirmata.com> * add check for update operations Signed-off-by: Jim Bugwadia <jim@nirmata.com> * increase time for deleteing a resource Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix check Signed-off-by: Jim Bugwadia <jim@nirmata.com> Co-authored-by: Shuting Zhao <shutting06@gmail.com>
110 lines
No EOL
3.3 KiB
YAML
110 lines
No EOL
3.3 KiB
YAML
name: e2e
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- 'charts/**'
|
|
- 'docs/**'
|
|
pull_request:
|
|
branches:
|
|
- 'main'
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- 'charts/**'
|
|
- 'docs/**'
|
|
|
|
jobs:
|
|
e2e-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Unshallow
|
|
run: git fetch --prune --unshallow
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.16
|
|
|
|
- name: Set up Helm
|
|
uses: azure/setup-helm@v1
|
|
with:
|
|
version: v3.5.0
|
|
|
|
- name: Set up chart-testing
|
|
uses: helm/chart-testing-action@v2.0.1
|
|
|
|
- name: Cache Go modules
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Test Policy
|
|
run: |
|
|
make test-cmd
|
|
|
|
- name: gofmt check
|
|
run: |
|
|
if [ "$(gofmt -s -l . | wc -l)" -ne 0 ]
|
|
then
|
|
echo "The following files were found to be not go formatted:"
|
|
gofmt -s -l .
|
|
echo "Please run 'make fmt' to go format the above files."
|
|
exit 1
|
|
fi
|
|
|
|
- name: golangci-lint
|
|
uses: reviewdog/action-golangci-lint@v1
|
|
|
|
- name: docker images build (AMD64)
|
|
run: |
|
|
make docker-build-all-amd64
|
|
|
|
- name : Create Kind Cluster and setup kustomize
|
|
run: |
|
|
make create-e2e-infrastruture
|
|
|
|
- name: e2e testing
|
|
run: |
|
|
echo ">>> Install Kyverno"
|
|
sed 's/imagePullPolicy:.*$/imagePullPolicy: IfNotPresent/g' ${GITHUB_WORKSPACE}/definitions/install.yaml | kubectl apply -f -
|
|
kubectl apply -f ${GITHUB_WORKSPACE}/definitions/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"
|
|
make test-e2e
|
|
kubectl delete -f ${GITHUB_WORKSPACE}/definitions/install.yaml
|
|
|
|
- name: Update chart values
|
|
run: |
|
|
sed -i -e "s|nameOverride:.*|nameOverride: kyverno|g" charts/kyverno/values.yaml
|
|
sed -i -e "s|fullnameOverride:.*|fullnameOverride: kyverno|g" charts/kyverno/values.yaml
|
|
sed -i -e "s|namespace:.*|namespace: kyverno|g" charts/kyverno/values.yaml
|
|
sed -i -e "s|tag:.*|tag: $(git describe --always --tags)|g" charts/kyverno/values.yaml
|
|
|
|
- name: Run chart-testing (install)
|
|
run: |
|
|
kubectl create namespace kyverno
|
|
ct install --target-branch=main --namespace=kyverno
|
|
|
|
- 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 |