2023-12-08 13:37:27 +00:00
|
|
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
|
|
|
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-10-25 04:29:31 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-09-27 08:24:27 +00:00
|
|
|
- name: Setup caches
|
|
|
|
uses: ./.github/actions/setup-caches
|
|
|
|
timeout-minutes: 5
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
build-cache-key: build-images
|
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-12-06 10:25:23 +00:00
|
|
|
with:
|
|
|
|
free-disk-space: false
|
2023-02-28 09:33:53 +00:00
|
|
|
- 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
|
2023-09-07 10:05:24 +00:00
|
|
|
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
2023-02-28 09:33:53 +00:00
|
|
|
with:
|
|
|
|
name: kyverno.tar
|
|
|
|
path: kyverno.tar
|
|
|
|
retention-days: 1
|
|
|
|
if-no-files-found: error
|
|
|
|
|
2023-09-01 10:21:35 +00:00
|
|
|
prepare-cli:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-25 04:29:31 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-09-27 08:24:27 +00:00
|
|
|
- name: Setup caches
|
|
|
|
uses: ./.github/actions/setup-caches
|
|
|
|
timeout-minutes: 5
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
build-cache-key: build-cli
|
2023-09-01 10:21:35 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
timeout-minutes: 10
|
2023-12-06 10:25:23 +00:00
|
|
|
with:
|
|
|
|
free-disk-space: false
|
2023-09-01 10:21:35 +00:00
|
|
|
- name: Build CLI
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
VERSION=${{ github.ref_name }} make build-cli
|
|
|
|
- name: upload images archive
|
2023-09-07 10:05:24 +00:00
|
|
|
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
2023-09-01 10:21:35 +00:00
|
|
|
with:
|
|
|
|
name: kubectl-kyverno
|
|
|
|
path: cmd/cli/kubectl-kyverno/kubectl-kyverno
|
|
|
|
retention-days: 1
|
|
|
|
if-no-files-found: error
|
|
|
|
|
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.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-12-14 21:59:48 +00:00
|
|
|
- name: v1.29
|
|
|
|
version: v1.29.0
|
2023-02-28 14:33:46 +00:00
|
|
|
tests:
|
2023-12-11 13:46:07 +00:00
|
|
|
- ^autogen$
|
|
|
|
- ^background-only$
|
|
|
|
- ^cleanup$
|
|
|
|
- ^deferred$
|
|
|
|
- ^events$
|
|
|
|
- ^exceptions$
|
|
|
|
- ^filter$
|
|
|
|
- ^generate$/^clusterpolicy$
|
|
|
|
- ^generate$/^policy$
|
|
|
|
- ^generate$/^validation$
|
|
|
|
- ^mutate$
|
|
|
|
- ^policy-validation$
|
|
|
|
- ^rangeoperators$
|
|
|
|
- ^rbac$
|
|
|
|
- ^reports$
|
|
|
|
- ^validate$
|
|
|
|
- ^verify-manifests$
|
|
|
|
- ^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 }}
|
2023-10-27 16:33:58 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 12:00:03 +00:00
|
|
|
# install tools
|
|
|
|
- name: Install helm
|
|
|
|
id: helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2023-10-27 16:33:58 +00:00
|
|
|
with:
|
2023-12-07 12:00:03 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install chainsaw
|
2024-01-02 07:43:46 +00:00
|
|
|
uses: kyverno/action-install-chainsaw@56be3cb4ec65a987b6ef4d7ab3a55ee17760a57c # v0.1.2
|
2023-12-07 12:00:03 +00:00
|
|
|
# create cluster
|
2023-10-27 16:33:58 +00:00
|
|
|
- name: Create kind cluster
|
2023-12-07 12:00:03 +00:00
|
|
|
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ matrix.k8s-version.version }}
|
|
|
|
cluster_name: kind
|
|
|
|
config: ./scripts/config/kind/default.yaml
|
|
|
|
# deploy kyverno
|
2023-10-27 16:33:58 +00:00
|
|
|
- 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
|
2023-12-07 12:00:03 +00:00
|
|
|
kind load image-archive kyverno.tar --name kind
|
2023-10-27 16:33:58 +00:00
|
|
|
- name: Install kyverno
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 12:00:03 +00:00
|
|
|
export HELM=${{ steps.helm.outputs.helm-path }}
|
2023-10-27 16:33:58 +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-12-07 12:00:03 +00:00
|
|
|
# run tests
|
2023-10-27 16:33:58 +00:00
|
|
|
- name: Test with Chainsaw
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-11 13:46:07 +00:00
|
|
|
cd ./test/conformance/chainsaw && chainsaw test --include-test-regex '^chainsaw$/${{ matrix.tests }}'
|
2023-12-07 12:00:03 +00:00
|
|
|
# debug
|
2023-11-20 17:26:37 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|
2023-12-07 12:00:03 +00:00
|
|
|
|
2023-11-24 21:33:34 +00:00
|
|
|
validatingadmissionpolicies-v1alpha1:
|
2023-11-20 17:26:37 +00:00
|
|
|
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.27
|
|
|
|
version: v1.27.3
|
|
|
|
tests:
|
|
|
|
- generate-validating-admission-policy
|
|
|
|
needs: prepare-images
|
2023-11-24 21:33:34 +00:00
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
2023-11-20 17:26:37 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 12:00:03 +00:00
|
|
|
# install tools
|
|
|
|
- name: Install helm
|
|
|
|
id: helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2023-11-20 17:26:37 +00:00
|
|
|
with:
|
2023-12-07 12:00:03 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install chainsaw
|
2024-01-02 07:43:46 +00:00
|
|
|
uses: kyverno/action-install-chainsaw@56be3cb4ec65a987b6ef4d7ab3a55ee17760a57c # v0.1.2
|
2023-12-07 12:00:03 +00:00
|
|
|
# create cluster
|
2023-11-20 17:26:37 +00:00
|
|
|
- name: Create kind cluster
|
2023-12-07 12:00:03 +00:00
|
|
|
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ matrix.k8s-version.version }}
|
|
|
|
cluster_name: kind
|
|
|
|
config: ./scripts/config/kind/vap-v1alpha1.yaml
|
|
|
|
# deploy kyverno
|
2023-11-20 17:26:37 +00:00
|
|
|
- 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
|
2023-12-07 12:00:03 +00:00
|
|
|
kind load image-archive kyverno.tar --name kind
|
2023-11-20 17:26:37 +00:00
|
|
|
- name: Install kyverno
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 12:00:03 +00:00
|
|
|
export HELM=${{ steps.helm.outputs.helm-path }}
|
2023-11-20 17:26:37 +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-12-07 12:00:03 +00:00
|
|
|
# run tests
|
2023-11-20 17:26:37 +00:00
|
|
|
- name: Test with Chainsaw
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 12:00:03 +00:00
|
|
|
cd ./test/conformance/chainsaw && chainsaw test --test-dir ./${{ matrix.tests }}
|
|
|
|
# debug
|
2023-11-20 17:26:37 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|
|
|
|
|
2023-11-24 21:33:34 +00:00
|
|
|
validatingadmissionpolicies-v1beta1:
|
2023-11-20 17:26:37 +00:00
|
|
|
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.28
|
|
|
|
version: v1.28.0
|
2023-12-15 07:37:47 +00:00
|
|
|
- name: v1.29
|
|
|
|
version: v1.29.0
|
2023-11-20 17:26:37 +00:00
|
|
|
tests:
|
|
|
|
- generate-validating-admission-policy
|
|
|
|
needs: prepare-images
|
2023-11-24 21:33:34 +00:00
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
2023-11-20 17:26:37 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 12:00:03 +00:00
|
|
|
# install tools
|
|
|
|
- name: Install helm
|
|
|
|
id: helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2023-11-20 17:26:37 +00:00
|
|
|
with:
|
2023-12-07 12:00:03 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install chainsaw
|
2024-01-02 07:43:46 +00:00
|
|
|
uses: kyverno/action-install-chainsaw@56be3cb4ec65a987b6ef4d7ab3a55ee17760a57c # v0.1.2
|
2023-12-07 12:00:03 +00:00
|
|
|
# create cluster
|
2023-11-20 17:26:37 +00:00
|
|
|
- name: Create kind cluster
|
2023-12-07 12:00:03 +00:00
|
|
|
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ matrix.k8s-version.version }}
|
|
|
|
cluster_name: kind
|
|
|
|
config: ./scripts/config/kind/vap-v1beta1.yaml
|
|
|
|
# deploy kyverno
|
2023-11-20 17:26:37 +00:00
|
|
|
- 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
|
2023-12-07 12:00:03 +00:00
|
|
|
kind load image-archive kyverno.tar --name kind
|
2023-11-20 17:26:37 +00:00
|
|
|
- name: Install kyverno
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 12:00:03 +00:00
|
|
|
export HELM=${{ steps.helm.outputs.helm-path }}
|
2023-11-20 17:26:37 +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-12-07 12:00:03 +00:00
|
|
|
# run tests
|
2023-11-20 20:08:32 +00:00
|
|
|
- name: Test with Chainsaw
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 12:00:03 +00:00
|
|
|
cd ./test/conformance/chainsaw && chainsaw test --test-dir ./${{ matrix.tests }}
|
|
|
|
# debug
|
2023-11-22 23:17:41 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|
|
|
|
|
2023-11-24 21:33:34 +00:00
|
|
|
validatingadmissionpolicies-reports-v1alpha1:
|
2023-11-22 23:17:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
packages: read
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- name: validating-admission-policy-reports
|
|
|
|
values:
|
|
|
|
- standard
|
|
|
|
- validating-admission-policy-reports
|
|
|
|
k8s-version:
|
|
|
|
- name: v1.26
|
|
|
|
version: v1.26.6
|
|
|
|
- name: v1.27
|
|
|
|
version: v1.27.3
|
|
|
|
tests:
|
|
|
|
- validating-admission-policy-reports
|
|
|
|
needs: prepare-images
|
2023-11-24 21:33:34 +00:00
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
2023-11-22 23:17:41 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 12:00:03 +00:00
|
|
|
# install tools
|
|
|
|
- name: Install helm
|
|
|
|
id: helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2023-11-22 23:17:41 +00:00
|
|
|
with:
|
2023-12-07 12:00:03 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install chainsaw
|
2024-01-02 07:43:46 +00:00
|
|
|
uses: kyverno/action-install-chainsaw@56be3cb4ec65a987b6ef4d7ab3a55ee17760a57c # v0.1.2
|
2023-12-07 12:00:03 +00:00
|
|
|
# create cluster
|
2023-11-22 23:17:41 +00:00
|
|
|
- name: Create kind cluster
|
2023-12-07 12:00:03 +00:00
|
|
|
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ matrix.k8s-version.version }}
|
|
|
|
cluster_name: kind
|
|
|
|
config: ./scripts/config/kind/vap-v1alpha1.yaml
|
|
|
|
# deploy kyverno
|
2023-11-22 23:17:41 +00:00
|
|
|
- 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
|
2023-12-07 12:00:03 +00:00
|
|
|
kind load image-archive kyverno.tar --name kind
|
2023-11-22 23:17:41 +00:00
|
|
|
- name: Install kyverno
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 12:00:03 +00:00
|
|
|
export HELM=${{ steps.helm.outputs.helm-path }}
|
2023-11-22 23:17:41 +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-12-07 12:00:03 +00:00
|
|
|
# run tests
|
2023-11-22 23:17:41 +00:00
|
|
|
- name: Test with Chainsaw
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 12:00:03 +00:00
|
|
|
cd ./test/conformance/chainsaw && chainsaw test --test-dir ./${{ matrix.tests }}
|
|
|
|
# debug
|
2023-11-22 23:17:41 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|
|
|
|
|
2023-11-24 21:33:34 +00:00
|
|
|
validatingadmissionpolicies-reports-v1beta1:
|
2023-11-22 23:17:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
packages: read
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- name: validating-admission-policy-reports
|
|
|
|
values:
|
|
|
|
- standard
|
|
|
|
- validating-admission-policy-reports
|
|
|
|
k8s-version:
|
|
|
|
- name: v1.28
|
|
|
|
version: v1.28.0
|
2023-12-15 07:37:47 +00:00
|
|
|
- name: v1.29
|
|
|
|
version: v1.29.0
|
2023-11-22 23:17:41 +00:00
|
|
|
tests:
|
|
|
|
- validating-admission-policy-reports
|
|
|
|
needs: prepare-images
|
2023-11-24 21:33:34 +00:00
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
2023-11-22 23:17:41 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 12:00:03 +00:00
|
|
|
# install tools
|
|
|
|
- name: Install helm
|
|
|
|
id: helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2023-11-22 23:17:41 +00:00
|
|
|
with:
|
2023-12-07 12:00:03 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install chainsaw
|
2024-01-02 07:43:46 +00:00
|
|
|
uses: kyverno/action-install-chainsaw@56be3cb4ec65a987b6ef4d7ab3a55ee17760a57c # v0.1.2
|
2023-12-07 12:00:03 +00:00
|
|
|
# create cluster
|
2023-11-22 23:17:41 +00:00
|
|
|
- name: Create kind cluster
|
2023-12-07 12:00:03 +00:00
|
|
|
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ matrix.k8s-version.version }}
|
|
|
|
cluster_name: kind
|
|
|
|
config: ./scripts/config/kind/vap-v1beta1.yaml
|
|
|
|
# deploy kyverno
|
2023-11-22 23:17:41 +00:00
|
|
|
- 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
|
2023-12-07 12:00:03 +00:00
|
|
|
kind load image-archive kyverno.tar --name kind
|
2023-11-22 23:17:41 +00:00
|
|
|
- name: Install kyverno
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 12:00:03 +00:00
|
|
|
export HELM=${{ steps.helm.outputs.helm-path }}
|
2023-11-22 23:17:41 +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-12-07 12:00:03 +00:00
|
|
|
# run tests
|
2023-11-22 23:17:41 +00:00
|
|
|
- name: Test with Chainsaw
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 12:00:03 +00:00
|
|
|
cd ./test/conformance/chainsaw && chainsaw test --test-dir ./${{ matrix.tests }}
|
|
|
|
# debug
|
2023-10-27 16:33:58 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|
|
|
|
|
2023-11-24 21:33:34 +00:00
|
|
|
force-failure-policy-ignore:
|
2023-08-02 14:47:40 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
packages: read
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
2023-11-24 21:33:34 +00:00
|
|
|
- name: force-failure-policy-ignore
|
2023-08-02 14:47:40 +00:00
|
|
|
values:
|
|
|
|
- standard
|
2023-11-24 21:33:34 +00:00
|
|
|
- force-failure-policy-ignore
|
2023-08-02 14:47:40 +00:00
|
|
|
k8s-version:
|
|
|
|
- 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-12-15 07:37:47 +00:00
|
|
|
- name: v1.29
|
|
|
|
version: v1.29.0
|
2023-08-02 14:47:40 +00:00
|
|
|
tests:
|
2023-11-24 21:33:34 +00:00
|
|
|
- force-failure-policy-ignore
|
|
|
|
- rbac
|
2023-08-02 14:47:40 +00:00
|
|
|
needs: prepare-images
|
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-25 04:29:31 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 12:00:03 +00:00
|
|
|
# install tools
|
|
|
|
- name: Install helm
|
|
|
|
id: helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2023-09-27 08:24:27 +00:00
|
|
|
with:
|
2023-12-07 12:00:03 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install chainsaw
|
2024-01-02 07:43:46 +00:00
|
|
|
uses: kyverno/action-install-chainsaw@56be3cb4ec65a987b6ef4d7ab3a55ee17760a57c # v0.1.2
|
2023-12-07 12:00:03 +00:00
|
|
|
# create cluster
|
2023-02-28 09:33:53 +00:00
|
|
|
- name: Create kind cluster
|
2023-12-07 12:00:03 +00:00
|
|
|
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ matrix.k8s-version.version }}
|
|
|
|
cluster_name: kind
|
|
|
|
config: ./scripts/config/kind/default.yaml
|
|
|
|
# deploy kyverno
|
2023-02-28 09:33:53 +00:00
|
|
|
- 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
|
2023-12-07 12:00:03 +00:00
|
|
|
kind load image-archive kyverno.tar --name kind
|
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-12-07 12:00:03 +00:00
|
|
|
export HELM=${{ steps.helm.outputs.helm-path }}
|
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
|
2023-12-07 12:00:03 +00:00
|
|
|
# run tests
|
2023-11-24 21:33:34 +00:00
|
|
|
- name: Test with Chainsaw
|
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
|
2023-12-07 12:00:03 +00:00
|
|
|
cd ./test/conformance/chainsaw && chainsaw test --test-dir ./${{ matrix.tests }}
|
|
|
|
# debug
|
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
|
|
|
|
2023-11-24 21:33:34 +00:00
|
|
|
ttl:
|
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:
|
2023-11-24 21:33:34 +00:00
|
|
|
- name: ttl
|
2023-04-13 09:08:54 +00:00
|
|
|
values:
|
|
|
|
- standard
|
2023-11-24 21:33:34 +00:00
|
|
|
- ttl
|
2023-04-10 20:30:49 +00:00
|
|
|
k8s-version:
|
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-12-15 07:37:47 +00:00
|
|
|
- name: v1.29
|
|
|
|
version: v1.29.0
|
2023-04-10 20:30:49 +00:00
|
|
|
tests:
|
2023-11-24 21:33:34 +00:00
|
|
|
- ttl
|
2023-04-10 20:30:49 +00:00
|
|
|
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-10-25 04:29:31 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 12:00:03 +00:00
|
|
|
# install tools
|
|
|
|
- name: Install helm
|
|
|
|
id: helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2023-09-27 08:24:27 +00:00
|
|
|
with:
|
2023-12-07 12:00:03 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install chainsaw
|
2024-01-02 07:43:46 +00:00
|
|
|
uses: kyverno/action-install-chainsaw@56be3cb4ec65a987b6ef4d7ab3a55ee17760a57c # v0.1.2
|
2023-12-07 12:00:03 +00:00
|
|
|
# create cluster
|
2023-04-10 20:30:49 +00:00
|
|
|
- name: Create kind cluster
|
2023-12-07 12:00:03 +00:00
|
|
|
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ matrix.k8s-version.version }}
|
|
|
|
cluster_name: kind
|
|
|
|
config: ./scripts/config/kind/default.yaml
|
|
|
|
# deploy kyverno
|
2023-04-10 20:30:49 +00:00
|
|
|
- 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
|
2023-12-07 12:00:03 +00:00
|
|
|
kind load image-archive kyverno.tar --name kind
|
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-12-07 12:00:03 +00:00
|
|
|
export HELM=${{ steps.helm.outputs.helm-path }}
|
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
|
2023-12-07 12:00:03 +00:00
|
|
|
# run tests
|
2023-11-24 22:34:17 +00:00
|
|
|
- name: Test with Chainsaw
|
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
|
2023-12-07 12:00:03 +00:00
|
|
|
cd ./test/conformance/chainsaw && chainsaw test --test-dir ./${{ matrix.tests }}
|
|
|
|
# debug
|
2023-08-31 10:25:21 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|
|
|
|
|
2023-09-18 13:16:08 +00:00
|
|
|
custom-sigstore:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
packages: read
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- name: custom-sigstore
|
|
|
|
values:
|
|
|
|
- standard
|
|
|
|
- custom-sigstore
|
|
|
|
k8s-version:
|
|
|
|
- name: v1.26
|
2023-10-20 10:30:02 +00:00
|
|
|
version: v1.26.x
|
2023-09-18 13:16:08 +00:00
|
|
|
- name: v1.27
|
2023-10-20 10:30:02 +00:00
|
|
|
version: v1.27.x
|
2023-09-18 13:16:08 +00:00
|
|
|
- name: v1.28
|
2023-10-20 10:30:02 +00:00
|
|
|
version: v1.28.x
|
2023-12-30 21:06:17 +00:00
|
|
|
- name: v1.29
|
|
|
|
version: v1.29.x
|
2023-09-18 13:16:08 +00:00
|
|
|
tests:
|
|
|
|
- custom-sigstore
|
|
|
|
needs: prepare-images
|
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-25 04:29:31 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 23:14:23 +00:00
|
|
|
# install tools
|
|
|
|
- name: Install helm
|
|
|
|
id: helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2023-09-27 08:24:27 +00:00
|
|
|
with:
|
2023-12-07 23:14:23 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install crane
|
|
|
|
uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c
|
|
|
|
- name: Install Cosign
|
2023-12-12 08:10:01 +00:00
|
|
|
uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149
|
2023-12-07 23:14:23 +00:00
|
|
|
- name: Install chainsaw
|
2024-01-02 07:43:46 +00:00
|
|
|
uses: kyverno/action-install-chainsaw@56be3cb4ec65a987b6ef4d7ab3a55ee17760a57c # v0.1.2
|
2023-12-07 23:14:23 +00:00
|
|
|
# create cluster
|
2023-09-18 13:16:08 +00:00
|
|
|
- name: Create kind cluster and setup Sigstore Scaffolding
|
2024-01-31 07:54:00 +00:00
|
|
|
uses: sigstore/scaffolding/actions/setup@2d10614e854828e2389881abe6c5cf76240897a7
|
2023-10-20 10:30:02 +00:00
|
|
|
with:
|
2023-12-30 21:06:17 +00:00
|
|
|
version: main
|
2023-10-20 10:30:02 +00:00
|
|
|
k8s-version: ${{ matrix.k8s-version.version }}
|
|
|
|
knative-version: '1.10.0'
|
2023-09-18 13:16:08 +00:00
|
|
|
- name: Create TUF values config map
|
|
|
|
run: |
|
2023-12-07 23:14:23 +00:00
|
|
|
set -e
|
2023-09-18 13:16:08 +00:00
|
|
|
kubectl create namespace kyverno
|
|
|
|
kubectl -n kyverno create configmap tufvalues --from-literal=TUF_MIRROR=$TUF_MIRROR --from-literal=FULCIO_URL=$FULCIO_URL --from-literal=REKOR_URL=$REKOR_URL --from-literal=CTLOG_URL=$CTLOG_URL --from-literal=ISSUER_URL=$ISSUER_URL
|
|
|
|
kubectl -n tuf-system get secrets tuf-root -oyaml | sed 's/namespace: .*/namespace: kyverno/' | kubectl create -f -
|
2023-12-07 23:14:23 +00:00
|
|
|
# deploy kyverno
|
2023-09-18 13:16:08 +00:00
|
|
|
- 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
|
2023-12-07 23:14:23 +00:00
|
|
|
kind load image-archive kyverno.tar --name kind
|
2023-09-18 13:16:08 +00:00
|
|
|
- name: Install kyverno
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 23:14:23 +00:00
|
|
|
export HELM=${{ steps.helm.outputs.helm-path }}
|
2023-09-18 13:16:08 +00:00
|
|
|
export USE_CONFIG=${{ join(matrix.config.values, ',') }}
|
2023-09-20 09:12:02 +00:00
|
|
|
make kind-install-kyverno
|
2023-12-07 23:14:23 +00:00
|
|
|
- name: Wait for kyverno ready
|
|
|
|
uses: ./.github/actions/kyverno-wait-ready
|
|
|
|
# prepare test image
|
2023-09-18 13:16:08 +00:00
|
|
|
- name: Create test image
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
DIGEST=$(crane digest cgr.dev/chainguard/static)
|
|
|
|
IMAGE_NAME=$(uuidgen | tr "[:upper:]" "[:lower:]")
|
|
|
|
TEST_IMAGE_URL=ttl.sh/${IMAGE_NAME}:1h
|
|
|
|
crane copy cgr.dev/chainguard/static@$DIGEST $TEST_IMAGE_URL
|
|
|
|
cosign initialize --mirror $TUF_MIRROR --root $TUF_MIRROR/root.json
|
|
|
|
COSIGN_EXPERIMENTAL=1 cosign sign --rekor-url $REKOR_URL --fulcio-url $FULCIO_URL $TEST_IMAGE_URL --identity-token `curl -s $ISSUER_URL` -y
|
|
|
|
echo "TEST_IMAGE_URL=$TEST_IMAGE_URL" >> $GITHUB_ENV
|
2023-12-07 23:14:23 +00:00
|
|
|
# run tests
|
2023-11-24 22:34:17 +00:00
|
|
|
- name: Test with Chainsaw
|
2023-09-18 13:16:08 +00:00
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 12:00:03 +00:00
|
|
|
cd ./test/conformance/chainsaw && chainsaw test --test-dir ./${{ matrix.tests }}
|
2023-09-18 13:16:08 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|
|
|
|
|
2023-04-11 12:50:53 +00:00
|
|
|
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.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-12-15 07:37:47 +00:00
|
|
|
- name: v1.29
|
|
|
|
version: v1.29.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-10-25 04:29:31 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 12:00:03 +00:00
|
|
|
# install tools
|
|
|
|
- name: Install helm
|
|
|
|
id: helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2023-09-27 08:24:27 +00:00
|
|
|
with:
|
2023-12-07 12:00:03 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install chainsaw
|
2024-01-02 07:43:46 +00:00
|
|
|
uses: kyverno/action-install-chainsaw@56be3cb4ec65a987b6ef4d7ab3a55ee17760a57c # v0.1.2
|
2023-12-07 12:00:03 +00:00
|
|
|
# create cluster
|
2023-04-11 12:50:53 +00:00
|
|
|
- name: Create kind cluster
|
2023-12-07 12:00:03 +00:00
|
|
|
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ matrix.k8s-version.version }}
|
|
|
|
cluster_name: kind
|
|
|
|
config: ./scripts/config/kind/default.yaml
|
|
|
|
# deploy kyverno
|
2023-04-11 12:50:53 +00:00
|
|
|
- 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
|
2023-12-07 12:00:03 +00:00
|
|
|
kind load image-archive kyverno.tar --name kind
|
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-12-07 12:00:03 +00:00
|
|
|
export HELM=${{ steps.helm.outputs.helm-path }}
|
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
|
2023-12-07 12:00:03 +00:00
|
|
|
# run tests
|
2023-11-24 22:34:17 +00:00
|
|
|
- name: Test with Chainsaw
|
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
|
2023-12-07 12:00:03 +00:00
|
|
|
cd ./test/conformance/chainsaw && chainsaw test --test-dir ./${{ matrix.tests }}
|
|
|
|
# debug
|
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
|
|
|
|
|
|
|
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.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-12-15 07:37:47 +00:00
|
|
|
- name: v1.29
|
|
|
|
version: v1.29.0
|
2023-07-21 11:22:29 +00:00
|
|
|
tests:
|
2023-12-06 09:54:08 +00:00
|
|
|
- ^argo$
|
|
|
|
- ^aws$
|
|
|
|
- ^best-practices$
|
|
|
|
- ^castai$
|
|
|
|
- ^cert-manager$
|
|
|
|
- ^consul$
|
|
|
|
- ^external-secret-operator$
|
|
|
|
- ^flux$
|
|
|
|
- ^istio$
|
|
|
|
- ^karpenter$
|
|
|
|
- ^kasten$
|
|
|
|
- ^kubecost$
|
|
|
|
- ^kubeops$
|
|
|
|
- ^kubevirt$
|
|
|
|
- ^linkerd$
|
|
|
|
- ^nginx-ingress$
|
|
|
|
- ^openshift$
|
|
|
|
- ^other$/^a
|
|
|
|
- ^other$/^[b-d]
|
|
|
|
- ^other$/^[e-l]
|
|
|
|
- ^other$/^[m-q]
|
|
|
|
- ^other$/^re[c-q]
|
|
|
|
- ^other$/^res
|
|
|
|
- ^other$/^[s-z]
|
|
|
|
- ^pod-security$
|
|
|
|
- ^pod-security-cel$
|
|
|
|
- ^psa$
|
|
|
|
- ^psp-migration$
|
|
|
|
# - ^tekton
|
|
|
|
# - ^traefik
|
|
|
|
# - ^velero
|
2023-09-01 10:21:35 +00:00
|
|
|
needs:
|
|
|
|
- prepare-images
|
|
|
|
- prepare-cli
|
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-10-25 04:29:31 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-06-19 15:17:24 +00:00
|
|
|
- name: Checkout kyverno/policies
|
2023-10-25 04:29:31 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-06-19 15:17:24 +00:00
|
|
|
with:
|
|
|
|
repository: kyverno/policies
|
|
|
|
path: policies
|
2023-12-07 23:14:23 +00:00
|
|
|
# install tools
|
|
|
|
- name: Install helm
|
|
|
|
id: helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2023-09-27 08:24:27 +00:00
|
|
|
with:
|
2023-12-07 23:14:23 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install chainsaw
|
2024-01-02 07:43:46 +00:00
|
|
|
uses: kyverno/action-install-chainsaw@56be3cb4ec65a987b6ef4d7ab3a55ee17760a57c # v0.1.2
|
2023-09-01 10:21:35 +00:00
|
|
|
- name: Download kyverno CLI archive
|
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
|
|
|
with:
|
|
|
|
name: kubectl-kyverno
|
|
|
|
- name: Install Kyverno CLI
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
chmod +x kubectl-kyverno && mv kubectl-kyverno ./cmd/cli/kubectl-kyverno/kyverno
|
|
|
|
echo "$PWD/cmd/cli/kubectl-kyverno" >> $GITHUB_PATH
|
2023-12-07 23:14:23 +00:00
|
|
|
# create cluster
|
|
|
|
- name: Create kind cluster
|
|
|
|
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ matrix.k8s-version.version }}
|
|
|
|
cluster_name: kind
|
|
|
|
config: ./scripts/config/kind/default.yaml
|
|
|
|
# deploy kyverno
|
|
|
|
- name: Download kyverno images archive
|
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
|
|
|
with:
|
|
|
|
name: kyverno.tar
|
2023-06-19 15:17:24 +00:00
|
|
|
- name: Load kyverno images archive in kind cluster
|
2023-08-31 13:19:23 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 23:14:23 +00:00
|
|
|
kind load image-archive kyverno.tar --name kind
|
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-12-07 23:14:23 +00:00
|
|
|
export HELM=${{ steps.helm.outputs.helm-path }}
|
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-12-07 23:14:23 +00:00
|
|
|
# run tests
|
2023-12-06 09:54:08 +00:00
|
|
|
- name: Install CRDs
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-12-07 12:00:03 +00:00
|
|
|
kubectl apply -f ./policies/.chainsaw/crds
|
2023-12-06 09:54:08 +00:00
|
|
|
- name: Test with Chainsaw
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
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-12-06 09:54:08 +00:00
|
|
|
chainsaw test --include-test-regex '^chainsaw$/${{ matrix.tests }}' --no-color=false
|
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
|
2023-10-25 04:29:31 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-09-27 08:24:27 +00:00
|
|
|
- name: Setup caches
|
|
|
|
uses: ./.github/actions/setup-caches
|
|
|
|
timeout-minutes: 5
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
2023-08-31 13:19:23 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
timeout-minutes: 10
|
|
|
|
- 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
|
2023-09-12 04:53:37 +00:00
|
|
|
|
|
|
|
check-tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
packages: read
|
|
|
|
needs: prepare-cli
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-25 04:29:31 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-09-12 04:53:37 +00:00
|
|
|
- name: Download kyverno CLI archive
|
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
|
|
|
with:
|
|
|
|
name: kubectl-kyverno
|
|
|
|
- name: Install Kyverno CLI
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
chmod +x kubectl-kyverno && mv kubectl-kyverno ./cmd/cli/kubectl-kyverno/kyverno
|
|
|
|
echo "$PWD/cmd/cli/kubectl-kyverno" >> $GITHUB_PATH
|
|
|
|
- name: Fix test files
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
2023-09-12 08:08:17 +00:00
|
|
|
KYVERNO_EXPERIMENTAL=true kyverno fix test ./test/cli --save --compress
|
2023-09-12 04:53:37 +00:00
|
|
|
make verify-cli-tests
|
2023-09-20 11:19:35 +00:00
|
|
|
|
2023-12-18 13:12:57 +00:00
|
|
|
conformance-required-success:
|
|
|
|
name: conformance-required
|
|
|
|
needs:
|
|
|
|
- standard
|
|
|
|
- ttl
|
|
|
|
- force-failure-policy-ignore
|
|
|
|
- validatingadmissionpolicies-v1alpha1
|
|
|
|
- validatingadmissionpolicies-v1beta1
|
|
|
|
- validatingadmissionpolicies-reports-v1alpha1
|
|
|
|
- validatingadmissionpolicies-reports-v1beta1
|
|
|
|
- custom-sigstore
|
|
|
|
- default
|
|
|
|
- monitor-helm-secret-size
|
|
|
|
- check-tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ success() }}
|
|
|
|
steps:
|
|
|
|
- run: ${{ true }}
|
|
|
|
|
|
|
|
conformance-required-failure:
|
|
|
|
name: conformance-required
|
2023-09-20 11:19:35 +00:00
|
|
|
needs:
|
|
|
|
- standard
|
|
|
|
- ttl
|
|
|
|
- force-failure-policy-ignore
|
2023-11-24 21:33:34 +00:00
|
|
|
- validatingadmissionpolicies-v1alpha1
|
|
|
|
- validatingadmissionpolicies-v1beta1
|
|
|
|
- validatingadmissionpolicies-reports-v1alpha1
|
|
|
|
- validatingadmissionpolicies-reports-v1beta1
|
2023-09-20 11:19:35 +00:00
|
|
|
- custom-sigstore
|
|
|
|
- default
|
|
|
|
- monitor-helm-secret-size
|
|
|
|
- check-tests
|
|
|
|
runs-on: ubuntu-latest
|
2023-12-18 13:12:57 +00:00
|
|
|
if: ${{ failure() || cancelled() }}
|
2023-09-20 11:19:35 +00:00
|
|
|
steps:
|
2023-12-18 13:12:57 +00:00
|
|
|
- run: ${{ false }}
|