|
| 1 | +--- |
| 2 | +suite: Override check |
| 3 | +templates: |
| 4 | + # primary template files |
| 5 | + - deployments.yaml |
| 6 | + - jobs.yaml |
| 7 | + - service-account.yaml |
| 8 | + |
| 9 | + # included templates must also be listed |
| 10 | + - configmaps_overrides.yaml |
| 11 | + - configmaps_packs.yaml |
| 12 | + - configmaps_rbac.yaml |
| 13 | + - configmaps_st2-conf.yaml |
| 14 | + - configmaps_st2-urls.yaml |
| 15 | + - configmaps_st2web.yaml |
| 16 | + - secrets_datastore_crypto_key.yaml |
| 17 | + - secrets_ssh.yaml |
| 18 | + - secrets_st2apikeys.yaml |
| 19 | + - secrets_st2auth.yaml |
| 20 | + - secrets_st2chatops.yaml |
| 21 | + |
| 22 | +tests: |
| 23 | + - it: Jobs with overrides mounted |
| 24 | + template: jobs.yaml |
| 25 | + set: |
| 26 | + st2: |
| 27 | + overrides: #Enabling the override mounts in register-content job. |
| 28 | + _global.yaml: | |
| 29 | + --- |
| 30 | + rules: |
| 31 | + defaults: |
| 32 | + enabled: false |
| 33 | + rbac: { enabled: true } # enable rbac job |
| 34 | + packs: { sensors: [] } # ensure only 1 sensor |
| 35 | + jobs: |
| 36 | + extra_hooks: &extra_hooks_jobs |
| 37 | + - name: upgrade-warning |
| 38 | + hook: pre-upgrade, pre-rollback |
| 39 | + hook_weight: -5 |
| 40 | + command: ["st2", "run", "--tail", "custom_pack.warn_about_upgrade"] |
| 41 | + release: |
| 42 | + name: st2ha |
| 43 | + asserts: |
| 44 | + - hasDocuments: |
| 45 | + count: 5 |
| 46 | + |
| 47 | + - contains: &override_volume |
| 48 | + path: spec.template.spec.volumes |
| 49 | + content: |
| 50 | + name: st2-overrides-vol |
| 51 | + configMap: |
| 52 | + name: st2ha-st2-override-configs |
| 53 | + documentIndex: 3 # register_content |
| 54 | + |
| 55 | + |
| 56 | + - contains: &override_mnt |
| 57 | + path: spec.template.spec.containers[0].volumeMounts |
| 58 | + content: |
| 59 | + name: st2-overrides-vol |
| 60 | + mountPath: /opt/stackstorm/overrides/ |
| 61 | + documentIndex: 3 # register_content |
| 62 | + |
| 63 | + - notContains: *override_volume |
| 64 | + documentIndex: 0 |
| 65 | + - notContains: *override_mnt |
| 66 | + documentIndex: 0 |
| 67 | + |
| 68 | + - notContains: *override_volume |
| 69 | + documentIndex: 1 |
| 70 | + - notContains: *override_mnt |
| 71 | + documentIndex: 1 |
| 72 | + |
| 73 | + - notContains: *override_volume |
| 74 | + documentIndex: 2 |
| 75 | + - notContains: *override_mnt |
| 76 | + documentIndex: 2 |
| 77 | + |
| 78 | + - it: Deployments with overrides |
| 79 | + template: deployments.yaml |
| 80 | + set: |
| 81 | + st2: |
| 82 | + overrides: #Enabling the override mounts in register-content job. |
| 83 | + _global.yaml: | |
| 84 | + --- |
| 85 | + rules: |
| 86 | + defaults: |
| 87 | + enabled: false |
| 88 | + packs: |
| 89 | + sensors: [] # ensure only 1 sensor |
| 90 | + images: [] # no extra packs to load |
| 91 | + volumes: |
| 92 | + enabled: false |
| 93 | + configs: {} # has one core.yaml config file by default (dicts get merged) |
| 94 | + st2chatops: |
| 95 | + enabled: true |
| 96 | + release: |
| 97 | + name: st2ha |
| 98 | + asserts: |
| 99 | + - hasDocuments: |
| 100 | + count: 14 |
| 101 | + |
| 102 | + |
| 103 | + - contains: *override_volume # always included |
| 104 | + documentIndex: 12 # st2client |
| 105 | + - contains: *override_mnt # always included |
| 106 | + documentIndex: 12 # st2client |
| 107 | + |
| 108 | + |
| 109 | + - notContains: *override_volume |
| 110 | + documentIndex: 1 |
| 111 | + - notContains: *override_mnt |
| 112 | + documentIndex: 1 # st2api |
| 113 | + - notContains: *override_volume # only contains if volumes.enabled |
| 114 | + documentIndex: 10 # st2actionrunner |
| 115 | + - notContains: *override_mnt # only contains if volumes.enabled |
| 116 | + documentIndex: 10 # st2actionrunner |
| 117 | + - notContains: *override_volume |
| 118 | + documentIndex: 0 |
| 119 | + - notContains: *override_mnt |
| 120 | + documentIndex: 0 |
| 121 | + - notContains: *override_volume |
| 122 | + documentIndex: 2 |
| 123 | + - notContains: *override_mnt |
| 124 | + documentIndex: 2 |
| 125 | + - notContains: *override_volume |
| 126 | + documentIndex: 3 |
| 127 | + - notContains: *override_mnt |
| 128 | + documentIndex: 3 |
| 129 | + - notContains: *override_volume |
| 130 | + documentIndex: 4 |
| 131 | + - notContains: *override_mnt |
| 132 | + documentIndex: 4 |
| 133 | + - notContains: *override_volume |
| 134 | + documentIndex: 5 |
| 135 | + - notContains: *override_mnt |
| 136 | + documentIndex: 5 |
| 137 | + - notContains: *override_volume |
| 138 | + documentIndex: 6 |
| 139 | + - notContains: *override_mnt |
| 140 | + documentIndex: 6 |
| 141 | + - notContains: *override_volume |
| 142 | + documentIndex: 7 |
| 143 | + - notContains: *override_mnt |
| 144 | + documentIndex: 7 |
| 145 | + - notContains: *override_volume |
| 146 | + documentIndex: 8 |
| 147 | + - notContains: *override_mnt |
| 148 | + documentIndex: 8 |
| 149 | + - notContains: *override_volume # never |
| 150 | + documentIndex: 9 # st2sensorcontainer |
| 151 | + - notContains: *override_mnt # never |
| 152 | + documentIndex: 9 # st2sensorcontainer |
| 153 | + - notContains: *override_volume |
| 154 | + documentIndex: 11 |
| 155 | + - notContains: *override_mnt |
| 156 | + documentIndex: 11 |
| 157 | + - notContains: *override_volume |
| 158 | + documentIndex: 13 |
| 159 | + - notContains: *override_mnt |
| 160 | + documentIndex: 13 |
0 commit comments