|
| 1 | +# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json |
| 2 | +apiVersion: chainsaw.kyverno.io/v1alpha1 |
| 3 | +kind: Test |
| 4 | +metadata: |
| 5 | + name: metadata-gzip-compression |
| 6 | + # Label to trigger the test on every PR |
| 7 | + labels: |
| 8 | + all: |
| 9 | + linodemachine: |
| 10 | +spec: |
| 11 | + bindings: |
| 12 | + # A short identifier for the E2E test run |
| 13 | + - name: run |
| 14 | + value: (join('-', ['e2e', 'metadata-gzip', env('GIT_REF')])) |
| 15 | + - name: cluster |
| 16 | + # Format the cluster name |
| 17 | + value: (trim((truncate(($run), `29`)), '-')) |
| 18 | + template: true |
| 19 | + steps: |
| 20 | + - name: Check if CAPI provider resources exist |
| 21 | + try: |
| 22 | + - assert: |
| 23 | + file: assert-capi-resources.yaml |
| 24 | + - name: Create Cluster resource |
| 25 | + try: |
| 26 | + - apply: |
| 27 | + file: create-cluster.yaml |
| 28 | + catch: |
| 29 | + - describe: |
| 30 | + apiVersion: cluster.x-k8s.io/v1beta1 |
| 31 | + kind: Cluster |
| 32 | + - name: Generate dummy cloud-config data |
| 33 | + try: |
| 34 | + - script: |
| 35 | + env: |
| 36 | + - name: NAMESPACE |
| 37 | + value: ($namespace) |
| 38 | + content: | |
| 39 | + set -e |
| 40 | +
|
| 41 | + # Some very compressible data |
| 42 | + printf %102400s | tr ' ' '🫵🤓' > chonk.txt |
| 43 | + kubectl -n $NAMESPACE create secret generic chonk-secret --from-file=chonk.txt |
| 44 | + check: |
| 45 | + ($error): ~ |
| 46 | + - name: Create LinodeMachine resource |
| 47 | + try: |
| 48 | + - apply: |
| 49 | + file: create-linodemachine.yaml |
| 50 | + - assert: |
| 51 | + file: assert-linodemachine.yaml |
| 52 | + catch: |
| 53 | + - describe: |
| 54 | + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2 |
| 55 | + kind: LinodeMachineTemplate |
| 56 | + - describe: |
| 57 | + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 |
| 58 | + kind: KubeadmControlPlane |
| 59 | + - name: Delete Cluster resource |
| 60 | + try: |
| 61 | + - delete: |
| 62 | + ref: |
| 63 | + apiVersion: cluster.x-k8s.io/v1beta1 |
| 64 | + kind: Cluster |
| 65 | + name: ($cluster) |
| 66 | + - error: |
| 67 | + file: check-linodemachine-deletion.yaml |
0 commit comments