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-08-25 07:17:21 +00:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2023-02-28 09:33:53 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-08-30 20:44:51 +00:00
|
|
|
timeout-minutes: 10
|
2023-02-28 09:33:53 +00:00
|
|
|
with:
|
|
|
|
build-cache-key: build-images
|
|
|
|
- name: ko build
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
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
|
2023-07-31 11:12:24 +00:00
|
|
|
permissions:
|
|
|
|
packages: read
|
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.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-08-16 08:49:45 +00:00
|
|
|
- name: v1.28
|
|
|
|
version: v1.28.0
|
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-08-21 00:46:42 +00:00
|
|
|
- filter
|
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-08-25 07:17:21 +00:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2023-01-05 15:52:52 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-08-30 20:44:51 +00:00
|
|
|
timeout-minutes: 10
|
2023-08-02 14:47:40 +00:00
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
|
|
|
- name: Create kind cluster
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-08-02 14:47:40 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
2023-08-02 14:47:40 +00:00
|
|
|
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
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
make kind-load-image-archive
|
2023-08-02 14:47:40 +00:00
|
|
|
- name: Install kyverno
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-08-02 14:47:40 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
2023-08-02 14:47:40 +00:00
|
|
|
export USE_CONFIG=${{ join(matrix.config.values, ',') }}
|
|
|
|
make kind-install-kyverno
|
|
|
|
- name: Wait for kyverno ready
|
|
|
|
uses: ./.github/actions/kyverno-wait-ready
|
|
|
|
- name: Test with kuttl
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-08-02 14:47:40 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
|
|
|
./.tools/kubectl-kuttl test ./test/conformance/kuttl/${{ matrix.tests }} --config ./test/conformance/kuttl/_config/common.yaml
|
2023-08-02 14:47:40 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|
|
|
|
|
|
|
|
# runs conformance test suites with configuration:
|
|
|
|
ttl:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
packages: read
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- name: ttl
|
|
|
|
values:
|
|
|
|
- standard
|
|
|
|
- ttl
|
|
|
|
k8s-version:
|
|
|
|
- name: v1.25
|
|
|
|
version: v1.25.11
|
|
|
|
- name: v1.26
|
|
|
|
version: v1.26.6
|
|
|
|
- name: v1.27
|
|
|
|
version: v1.27.3
|
2023-08-16 08:49:45 +00:00
|
|
|
- name: v1.28
|
|
|
|
version: v1.28.0
|
2023-08-02 14:47:40 +00:00
|
|
|
tests:
|
|
|
|
- ttl
|
|
|
|
needs: prepare-images
|
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-08-25 07:17:21 +00:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2023-08-02 14:47:40 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-08-30 20:44:51 +00:00
|
|
|
timeout-minutes: 10
|
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
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-02-28 09:33:53 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
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
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
make kind-load-image-archive
|
2023-02-28 09:33:53 +00:00
|
|
|
- name: Install kyverno
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-04-13 09:08:54 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
2023-04-13 09:08:54 +00:00
|
|
|
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-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-07-31 11:12:24 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-02-28 14:33:46 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
|
|
|
./.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-07-31 11:12:24 +00:00
|
|
|
permissions:
|
|
|
|
packages: read
|
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.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-08-16 08:49:45 +00:00
|
|
|
- name: v1.28
|
|
|
|
version: v1.28.0
|
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-08-25 07:17:21 +00:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2023-04-10 20:30:49 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-08-30 20:44:51 +00:00
|
|
|
timeout-minutes: 10
|
2023-04-10 20:30:49 +00:00
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
|
|
|
- name: Create kind cluster
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-04-10 20:30:49 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
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
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
make kind-load-image-archive
|
2023-04-10 20:30:49 +00:00
|
|
|
- name: Install kyverno
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-04-10 20:30:49 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
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
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-07-31 11:12:24 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-04-10 20:30:49 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
|
|
|
./.tools/kubectl-kuttl test ./test/conformance/kuttl/${{ matrix.tests }} --config ./test/conformance/kuttl/_config/common.yaml
|
2023-08-31 10:25:21 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|
|
|
|
|
|
|
|
# runs conformance test suites with configuration:
|
|
|
|
validating-admission-policies:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
packages: read
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- name: validating-admission-policies
|
|
|
|
values:
|
|
|
|
- standard
|
|
|
|
- generate-validating-admission-policy
|
|
|
|
k8s-version:
|
|
|
|
- name: v1.26
|
|
|
|
version: v1.26.6
|
|
|
|
- name: v1.27
|
|
|
|
version: v1.27.3
|
|
|
|
tests:
|
|
|
|
- generate-validating-admission-policy
|
|
|
|
needs: prepare-images
|
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-01 07:21:45 +00:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2023-08-31 10:25:21 +00:00
|
|
|
- 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 }}
|
|
|
|
export KIND_CONFIG=vap-v1alpha1
|
|
|
|
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
|
|
|
|
- name: Test with kuttl
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
./.tools/kubectl-kuttl test ./test/conformance/kuttl/${{ matrix.tests }} \
|
2023-04-10 20:30:49 +00:00
|
|
|
--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-07-31 11:12:24 +00:00
|
|
|
permissions:
|
|
|
|
packages: read
|
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.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-08-16 08:49:45 +00:00
|
|
|
- name: v1.28
|
|
|
|
version: v1.28.0
|
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-08-25 07:17:21 +00:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2023-04-11 12:50:53 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-08-30 20:44:51 +00:00
|
|
|
timeout-minutes: 10
|
2023-04-11 12:50:53 +00:00
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
|
|
|
- name: Create kind cluster
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-04-11 12:50:53 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
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
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
make kind-load-image-archive
|
2023-04-11 12:50:53 +00:00
|
|
|
- name: Install kyverno
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-04-11 12:50:53 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
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
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-07-31 11:12:24 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-04-11 12:50:53 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
|
|
|
./.tools/kubectl-kuttl test ./test/conformance/kuttl/${{ matrix.tests }} --config ./test/conformance/kuttl/_config/common.yaml
|
2023-04-11 12:50:53 +00:00
|
|
|
- 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.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-08-16 08:49:45 +00:00
|
|
|
- name: v1.28
|
|
|
|
version: v1.28.0
|
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
|
2023-08-25 07:17:21 +00:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2023-06-19 15:17:24 +00:00
|
|
|
- name: Checkout kyverno/policies
|
2023-08-25 07:17:21 +00:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2023-06-19 15:17:24 +00:00
|
|
|
with:
|
|
|
|
repository: kyverno/policies
|
|
|
|
path: policies
|
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-08-30 20:44:51 +00:00
|
|
|
timeout-minutes: 10
|
2023-06-19 15:17:24 +00:00
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
|
|
|
- name: Create kind cluster
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-06-19 15:17:24 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
2023-06-19 15:17:24 +00:00
|
|
|
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
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
make kind-load-image-archive
|
2023-06-19 15:17:24 +00:00
|
|
|
- name: Install kyverno
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-06-19 15:17:24 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
2023-06-19 15:17:24 +00:00
|
|
|
export USE_CONFIG=${{ join(matrix.config.values, ',') }}
|
|
|
|
make kind-install-kyverno
|
|
|
|
- name: Wait for kyverno ready
|
|
|
|
uses: ./.github/actions/kyverno-wait-ready
|
2023-08-29 09:58:27 +00:00
|
|
|
- name: Build Kyverno CLI
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-08-29 09:58:27 +00:00
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
make build-cli
|
|
|
|
ln -s $PWD/cmd/cli/kubectl-kyverno/kubectl-kyverno ./cmd/cli/kubectl-kyverno/kyverno
|
|
|
|
echo "$PWD/cmd/cli/kubectl-kyverno" >> $GITHUB_PATH
|
2023-06-19 15:17:24 +00:00
|
|
|
- name: Test policy library with kuttl
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
2023-06-19 15:17:24 +00:00
|
|
|
run: |
|
2023-08-31 13:19:23 +00:00
|
|
|
set -e
|
2023-06-19 15:17:24 +00:00
|
|
|
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
|
2023-08-31 13:19:23 +00:00
|
|
|
|
|
|
|
monitor-helm-secret-size:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
packages: read
|
|
|
|
needs: prepare-images
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
timeout-minutes: 10
|
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
|
|
|
- name: Create kind cluster
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
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
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
make kind-load-image-archive
|
|
|
|
- name: Install kyverno
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
make kind-install-kyverno
|
|
|
|
- name: Wait for kyverno ready
|
|
|
|
uses: ./.github/actions/kyverno-wait-ready
|
|
|
|
- name: Check secret size
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
SIZE=$(kubectl get secrets -n kyverno sh.helm.release.v1.kyverno.v1 -o jsonpath='{.data.release}' | base64 -d | wc -c | awk '{print $1}')
|
|
|
|
MAX_ALLOWED=1030000
|
|
|
|
if [ "$SIZE" -gt "$MAX_ALLOWED" ]; then
|
|
|
|
echo "Helm secret size ($SIZE bytes) is above the max allowed ($MAX_ALLOWED bytes)"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "Helm secret size ($SIZE bytes) is below the max allowed ($MAX_ALLOWED bytes)"
|
|
|
|
fi
|