| 11 | } |
| 12 | |
| 13 | func TestApply(t *testing.T) { |
| 14 | testCases := map[string]applyTestCase{ |
| 15 | // If it were processed, the indentation would be reset to 4 spaces |
| 16 | "noop no patches": { |
| 17 | input: ` |
| 18 | apiVersion: v1 |
| 19 | kind: Pod |
| 20 | metadata: |
| 21 | name: vela-core-application-test |
| 22 | namespace: vela-system |
| 23 | spec: |
| 24 | containers: |
| 25 | - command: |
| 26 | - /bin/bash |
| 27 | - -ec |
| 28 | - |2 |
| 29 | |
| 30 | set -e |
| 31 | |
| 32 | echo "Application and its components are created" |
| 33 | image: oamdev/alpine-k8s:1.18.2 |
| 34 | imagePullPolicy: IfNotPresent |
| 35 | name: vela-core-application-test |
| 36 | restartPolicy: Never |
| 37 | serviceAccountName: vela-core |
| 38 | `, |
| 39 | output: ` |
| 40 | apiVersion: v1 |
| 41 | kind: Pod |
| 42 | metadata: |
| 43 | name: vela-core-application-test |
| 44 | namespace: vela-system |
| 45 | spec: |
| 46 | containers: |
| 47 | - command: |
| 48 | - /bin/bash |
| 49 | - -ec |
| 50 | - |2 |
| 51 | |
| 52 | set -e |
| 53 | |
| 54 | echo "Application and its components are created" |
| 55 | image: oamdev/alpine-k8s:1.18.2 |
| 56 | imagePullPolicy: IfNotPresent |
| 57 | name: vela-core-application-test |
| 58 | restartPolicy: Never |
| 59 | serviceAccountName: vela-core |
| 60 | `, |
| 61 | }, |
| 62 | // TODO Failing test cases |
| 63 | // "applies patch": { |
| 64 | // input: `apiVersion: v1 |
| 65 | //kind: Pod |
| 66 | //metadata: |
| 67 | // annotations: |
| 68 | // helm.sh/hook: test |
| 69 | // helm.sh/hook-delete-policy: hook-succeeded |
| 70 | // name: vela-core-application-test |