|
1 | 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
|
2 | 2 | apiVersion: chainsaw.kyverno.io/v1alpha1
|
3 | 3 | kind: Test
|
| 4 | +metadata: |
| 5 | + name: mutate-new-namespace-konfluxcidev |
| 6 | +spec: |
| 7 | + description: | |
| 8 | + tests that the KubeArchiveConfig is created in a namespace |
| 9 | + labelled with `konflux-ci.dev/type=tenant` |
| 10 | + concurrent: false |
| 11 | + namespace: 'generate-new-namespace' |
| 12 | + bindings: |
| 13 | + - name: suffix |
| 14 | + value: konfluxcidev |
| 15 | + steps: |
| 16 | + - name: given-kubearchiveconfig-crd-exists |
| 17 | + try: |
| 18 | + - apply: |
| 19 | + file: resources/kubearchive-crd.yaml |
| 20 | + - name: given-kyverno-has-permission-on-resources |
| 21 | + try: |
| 22 | + - apply: |
| 23 | + file: ../kyverno_rbac.yaml |
| 24 | + - name: given-cluster-policy-is-ready |
| 25 | + try: |
| 26 | + - apply: |
| 27 | + file: ../bootstrap-namespace.yaml |
| 28 | + - assert: |
| 29 | + file: chainsaw-assert-clusterpolicy.yaml |
| 30 | + - name: when-konfluxcidev-labeled-namespace-is-created |
| 31 | + try: |
| 32 | + - apply: |
| 33 | + file: resources/actual-namespace-konfluxcidev.yaml |
| 34 | + template: true |
| 35 | + - name: then-kubearchiveconfig-is-created |
| 36 | + try: |
| 37 | + - assert: |
| 38 | + file: resources/expected-kubearchiveconfig.yaml |
| 39 | + template: true |
| 40 | +--- |
| 41 | +# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json |
| 42 | +apiVersion: chainsaw.kyverno.io/v1alpha1 |
| 43 | +kind: Test |
4 | 44 | metadata:
|
5 | 45 | name: mutate-new-namespace-konflux
|
6 | 46 | spec:
|
@@ -200,6 +240,46 @@ spec:
|
200 | 240 | # yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
|
201 | 241 | apiVersion: chainsaw.kyverno.io/v1alpha1
|
202 | 242 | kind: Test
|
| 243 | +metadata: |
| 244 | + name: mutate-existing-namespace-konfluxcidev |
| 245 | +spec: |
| 246 | + description: | |
| 247 | + tests that the KubeArchiveConfig is created in an already existing |
| 248 | + namespace labelled with `konflux-ci.dev/type=tenant` |
| 249 | + concurrent: false |
| 250 | + namespace: 'generate-existing-namespace' |
| 251 | + bindings: |
| 252 | + - name: suffix |
| 253 | + value: konflux |
| 254 | + steps: |
| 255 | + - name: given-kubearchiveconfig-crd-exists |
| 256 | + try: |
| 257 | + - apply: |
| 258 | + file: resources/kubearchive-crd.yaml |
| 259 | + - name: given-kyverno-has-permission-on-resources |
| 260 | + try: |
| 261 | + - apply: |
| 262 | + file: ../kyverno_rbac.yaml |
| 263 | + - name: given-konfluxci-labeled-namespace-is-created |
| 264 | + try: |
| 265 | + - apply: |
| 266 | + file: resources/actual-namespace-konfluxcidev.yaml |
| 267 | + template: true |
| 268 | + - name: when-cluster-policy-is-ready |
| 269 | + try: |
| 270 | + - apply: |
| 271 | + file: ../bootstrap-namespace.yaml |
| 272 | + - assert: |
| 273 | + file: chainsaw-assert-clusterpolicy.yaml |
| 274 | + - name: then-kubearchiveconfig-is-created |
| 275 | + try: |
| 276 | + - assert: |
| 277 | + file: resources/expected-kubearchiveconfig.yaml |
| 278 | + template: true |
| 279 | +--- |
| 280 | +# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json |
| 281 | +apiVersion: chainsaw.kyverno.io/v1alpha1 |
| 282 | +kind: Test |
203 | 283 | metadata:
|
204 | 284 | name: mutate-existing-namespace-toolchain
|
205 | 285 | spec:
|
|
0 commit comments