2022-10-20 12:17:33 +00:00
|
|
|
name: Conformance tests
|
2023-01-02 20:51:18 +00:00
|
|
|
|
2023-06-30 11:44:57 +00:00
|
|
|
permissions: {}
|
|
|
|
|
2022-10-20 12:17:33 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'release*'
|
|
|
|
|
2022-11-23 13:29:57 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-10-20 12:17:33 +00:00
|
|
|
jobs:
|
2023-02-28 09:33:53 +00:00
|
|
|
prepare-images:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-06-12 08:11:03 +00:00
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-02-28 09:33:53 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
with:
|
|
|
|
build-cache-key: build-images
|
|
|
|
- name: ko build
|
2023-04-07 12:10:53 +00:00
|
|
|
run: VERSION=${{ github.ref_name }} make docker-save-image-all
|
2023-02-28 09:33:53 +00:00
|
|
|
- name: upload images archive
|
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
|
|
|
with:
|
|
|
|
name: kyverno.tar
|
|
|
|
path: kyverno.tar
|
|
|
|
retention-days: 1
|
|
|
|
if-no-files-found: error
|
|
|
|
|
2023-04-10 20:30:49 +00:00
|
|
|
# runs conformance test suites with configuration:
|
2023-04-13 09:08:54 +00:00
|
|
|
standard:
|
2023-06-21 09:47:15 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-12-21 10:14:53 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-04-13 09:08:54 +00:00
|
|
|
config:
|
|
|
|
- name: standard
|
|
|
|
values:
|
|
|
|
- standard
|
2023-02-28 14:33:46 +00:00
|
|
|
k8s-version:
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.24
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.24.15
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.25
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.25.11
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.26
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.26.6
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.27
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.27.3
|
2023-02-28 14:33:46 +00:00
|
|
|
tests:
|
|
|
|
- autogen
|
2023-06-29 12:53:23 +00:00
|
|
|
- background-only
|
2023-02-28 14:33:46 +00:00
|
|
|
- cleanup
|
2023-06-27 16:58:50 +00:00
|
|
|
- deferred
|
2023-02-28 14:33:46 +00:00
|
|
|
- events
|
|
|
|
- exceptions
|
2023-04-13 09:50:35 +00:00
|
|
|
- generate/clusterpolicy
|
|
|
|
- generate/policy
|
|
|
|
- generate/validation
|
2023-02-28 14:33:46 +00:00
|
|
|
- mutate
|
2023-03-22 17:12:10 +00:00
|
|
|
- policy-validation
|
2023-02-28 14:33:46 +00:00
|
|
|
- rangeoperators
|
|
|
|
- rbac
|
|
|
|
- reports
|
|
|
|
- validate
|
2023-03-27 16:19:19 +00:00
|
|
|
- verify-manifests
|
2023-02-28 14:33:46 +00:00
|
|
|
- verifyImages
|
|
|
|
- webhooks
|
2023-02-28 09:33:53 +00:00
|
|
|
needs: prepare-images
|
2023-04-13 09:08:54 +00:00
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
2022-10-20 12:17:33 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-06-12 08:11:03 +00:00
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-01-05 15:52:52 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2022-10-20 12:17:33 +00:00
|
|
|
with:
|
2023-01-05 15:52:52 +00:00
|
|
|
build-cache-key: run-conformance
|
2023-02-28 09:33:53 +00:00
|
|
|
- name: Create kind cluster
|
|
|
|
run: |
|
2023-04-13 09:08:54 +00:00
|
|
|
export KIND_IMAGE=kindest/node:${{ matrix.k8s-version.version }}
|
2023-02-28 09:33:53 +00:00
|
|
|
make kind-create-cluster
|
|
|
|
- name: Download kyverno images archive
|
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
2023-01-05 22:36:13 +00:00
|
|
|
with:
|
2023-02-28 09:33:53 +00:00
|
|
|
name: kyverno.tar
|
|
|
|
- name: Load kyverno images archive in kind cluster
|
|
|
|
run: make kind-load-image-archive
|
|
|
|
- name: Install kyverno
|
2023-04-13 09:08:54 +00:00
|
|
|
run: |
|
|
|
|
export USE_CONFIG=${{ join(matrix.config.values, ',') }}
|
|
|
|
make kind-install-kyverno
|
2023-02-28 09:33:53 +00:00
|
|
|
- name: Wait for kyverno ready
|
|
|
|
uses: ./.github/actions/kyverno-wait-ready
|
2022-11-04 14:00:31 +00:00
|
|
|
- name: Test with kuttl
|
2023-02-28 14:33:46 +00:00
|
|
|
run: |
|
|
|
|
./.tools/kubectl-kuttl test ./test/conformance/kuttl/${{ matrix.tests }} \
|
|
|
|
--config ./test/conformance/kuttl/_config/common.yaml
|
2022-11-14 20:34:56 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
2023-01-05 11:35:04 +00:00
|
|
|
uses: ./.github/actions/kyverno-logs
|
2023-04-10 20:30:49 +00:00
|
|
|
|
|
|
|
# runs conformance test suites with configuration:
|
|
|
|
force-failure-policy-ignore:
|
2023-06-21 09:47:15 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-10 20:30:49 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-04-13 09:08:54 +00:00
|
|
|
config:
|
|
|
|
- name: force-failure-policy-ignore
|
|
|
|
values:
|
|
|
|
- standard
|
|
|
|
- force-failure-policy-ignore
|
2023-04-10 20:30:49 +00:00
|
|
|
k8s-version:
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.24
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.24.15
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.25
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.25.11
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.26
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.26.6
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.27
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.27.3
|
2023-04-10 20:30:49 +00:00
|
|
|
tests:
|
|
|
|
- force-failure-policy-ignore
|
|
|
|
- rbac
|
|
|
|
needs: prepare-images
|
2023-04-13 09:08:54 +00:00
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
2023-04-10 20:30:49 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-06-12 08:11:03 +00:00
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-04-10 20:30:49 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
|
|
|
- name: Create kind cluster
|
|
|
|
run: |
|
2023-04-13 09:08:54 +00:00
|
|
|
export KIND_IMAGE=kindest/node:${{ matrix.k8s-version.version }}
|
2023-04-10 20:30:49 +00:00
|
|
|
make kind-create-cluster
|
|
|
|
- name: Download kyverno images archive
|
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
|
|
|
with:
|
|
|
|
name: kyverno.tar
|
|
|
|
- name: Load kyverno images archive in kind cluster
|
|
|
|
run: make kind-load-image-archive
|
|
|
|
- name: Install kyverno
|
|
|
|
run: |
|
2023-04-13 09:08:54 +00:00
|
|
|
export USE_CONFIG=${{ join(matrix.config.values, ',') }}
|
2023-04-10 20:30:49 +00:00
|
|
|
make kind-install-kyverno
|
|
|
|
- name: Wait for kyverno ready
|
|
|
|
uses: ./.github/actions/kyverno-wait-ready
|
|
|
|
- name: Test with kuttl
|
|
|
|
run: |
|
|
|
|
./.tools/kubectl-kuttl test ./test/conformance/kuttl/${{ matrix.tests }} \
|
|
|
|
--config ./test/conformance/kuttl/_config/common.yaml
|
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|
2023-04-11 12:50:53 +00:00
|
|
|
|
|
|
|
# runs conformance test suites with configuration:
|
|
|
|
default:
|
2023-06-21 09:47:15 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-11 12:50:53 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-04-13 09:08:54 +00:00
|
|
|
config:
|
|
|
|
- name: default
|
|
|
|
values:
|
|
|
|
- default
|
2023-04-11 12:50:53 +00:00
|
|
|
k8s-version:
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.24
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.24.15
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.25
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.25.11
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.26
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.26.6
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.27
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.27.3
|
2023-04-11 12:50:53 +00:00
|
|
|
tests:
|
|
|
|
- rbac
|
|
|
|
needs: prepare-images
|
2023-04-13 09:08:54 +00:00
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
2023-04-11 12:50:53 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-06-12 08:11:03 +00:00
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-04-11 12:50:53 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
|
|
|
- name: Create kind cluster
|
|
|
|
run: |
|
2023-04-13 09:08:54 +00:00
|
|
|
export KIND_IMAGE=kindest/node:${{ matrix.k8s-version.version }}
|
2023-04-11 12:50:53 +00:00
|
|
|
make kind-create-cluster
|
|
|
|
- name: Download kyverno images archive
|
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
|
|
|
with:
|
|
|
|
name: kyverno.tar
|
|
|
|
- name: Load kyverno images archive in kind cluster
|
|
|
|
run: make kind-load-image-archive
|
|
|
|
- name: Install kyverno
|
|
|
|
run: |
|
2023-04-13 09:08:54 +00:00
|
|
|
export USE_CONFIG=${{ join(matrix.config.values, ',') }}
|
2023-04-11 12:50:53 +00:00
|
|
|
make kind-install-kyverno
|
|
|
|
- name: Wait for kyverno ready
|
|
|
|
uses: ./.github/actions/kyverno-wait-ready
|
|
|
|
- name: Test with kuttl
|
|
|
|
run: |
|
|
|
|
./.tools/kubectl-kuttl test ./test/conformance/kuttl/${{ matrix.tests }} \
|
|
|
|
--config ./test/conformance/kuttl/_config/common.yaml
|
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|
2023-06-19 15:17:24 +00:00
|
|
|
|
|
|
|
# runs conformance test suites with configuration:
|
|
|
|
policy-library:
|
2023-06-21 09:47:15 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-06-19 15:17:24 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- name: policy-library
|
|
|
|
values:
|
|
|
|
- standard
|
|
|
|
k8s-version:
|
|
|
|
- name: v1.24
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.24.15
|
2023-06-19 15:17:24 +00:00
|
|
|
- name: v1.25
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.25.11
|
2023-06-19 15:17:24 +00:00
|
|
|
- name: v1.26
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.26.6
|
2023-06-19 15:17:24 +00:00
|
|
|
- name: v1.27
|
2023-07-03 11:30:17 +00:00
|
|
|
version: v1.27.3
|
2023-07-21 11:22:29 +00:00
|
|
|
tests:
|
|
|
|
- argo
|
|
|
|
- aws
|
|
|
|
- best-practices
|
|
|
|
- castai
|
|
|
|
- cert-manager
|
|
|
|
- consul
|
|
|
|
- external-secret-operator
|
|
|
|
- flux
|
|
|
|
- istio
|
|
|
|
- karpenter
|
|
|
|
- kasten
|
|
|
|
- kubecost
|
|
|
|
- kubeops
|
|
|
|
- kubevirt
|
|
|
|
- linkerd
|
|
|
|
- nginx-ingress
|
|
|
|
- openshift
|
2023-07-31 08:05:23 +00:00
|
|
|
# - other
|
|
|
|
- other/a
|
|
|
|
- other/b-d
|
|
|
|
- other/e-l
|
|
|
|
- other/m-q
|
|
|
|
- other/rec-req
|
|
|
|
- other/res
|
|
|
|
- other/s-z
|
2023-07-21 11:22:29 +00:00
|
|
|
# - pod-security
|
|
|
|
# - psa
|
|
|
|
- psp-migration
|
|
|
|
# - tekton
|
|
|
|
# - traefik
|
|
|
|
# - velero
|
2023-06-19 15:17:24 +00:00
|
|
|
needs: prepare-images
|
2023-07-21 11:22:29 +00:00
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
2023-06-19 15:17:24 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout kyverno/kyverno
|
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
|
|
|
- name: Checkout kyverno/policies
|
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
|
|
|
with:
|
|
|
|
repository: kyverno/policies
|
|
|
|
path: policies
|
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
|
|
|
- name: Create kind cluster
|
|
|
|
run: |
|
|
|
|
export KIND_IMAGE=kindest/node:${{ matrix.k8s-version.version }}
|
|
|
|
make kind-create-cluster
|
|
|
|
- name: Download kyverno images archive
|
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
|
|
|
with:
|
|
|
|
name: kyverno.tar
|
|
|
|
- name: Load kyverno images archive in kind cluster
|
|
|
|
run: make kind-load-image-archive
|
|
|
|
- name: Install kyverno
|
|
|
|
run: |
|
|
|
|
export USE_CONFIG=${{ join(matrix.config.values, ',') }}
|
|
|
|
make kind-install-kyverno
|
|
|
|
- name: Wait for kyverno ready
|
|
|
|
uses: ./.github/actions/kyverno-wait-ready
|
2023-07-10 07:07:38 +00:00
|
|
|
- name: Install latest Kyverno CLI
|
|
|
|
run: |
|
|
|
|
download_url=$(curl -s "https://api.github.com/repos/kyverno/kyverno/releases/latest" | grep browser_download_url | grep kyverno-cli | grep linux_x86_64.tar.gz\" | cut -d '"' -f 4)
|
|
|
|
curl -L "$download_url" -o kyverno-cli.tar.gz
|
|
|
|
tar -xvf kyverno-cli.tar.gz
|
|
|
|
sudo cp kyverno /usr/local/bin/
|
2023-06-19 15:17:24 +00:00
|
|
|
- name: Test policy library with kuttl
|
|
|
|
run: |
|
|
|
|
cd policies
|
2023-07-21 11:22:29 +00:00
|
|
|
../.tools/kubectl-kuttl test ./${{ matrix.tests }} --config ./kuttl-test.yaml
|
2023-06-19 15:17:24 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|