|
2 | 2 | suite: Secret files
|
3 | 3 | templates:
|
4 | 4 | # primary template files
|
| 5 | + - secrets_datastore_crypto_key.yaml |
5 | 6 | - secrets_st2auth.yaml
|
6 | 7 | - deployments.yaml
|
7 | 8 | - jobs.yaml
|
@@ -113,3 +114,111 @@ tests:
|
113 | 114 | path: spec.template.spec.initContainers[1].envFrom[1].secretRef.name
|
114 | 115 | value: "hello-world"
|
115 | 116 | documentIndex: 1 # st2-key-load
|
| 117 | + |
| 118 | + - it: ST2 Datastore Crypto Key Secret include by default |
| 119 | + template: secrets_datastore_crypto_key.yaml |
| 120 | + set: |
| 121 | + st2: {} |
| 122 | + release: |
| 123 | + name: st2ha |
| 124 | + asserts: |
| 125 | + - hasDocuments: |
| 126 | + count: 1 |
| 127 | + - isNotEmpty: |
| 128 | + path: data.datastore_crypto_key |
| 129 | + documentIndex: 0 |
| 130 | + |
| 131 | + - it: ST2 Datastore Crypto Key Secret set custom username and password |
| 132 | + template: secrets_datastore_crypto_key.yaml |
| 133 | + set: |
| 134 | + st2: |
| 135 | + datastore_crypto_key: >- |
| 136 | + {"hmacKey": {"hmacKeyString": "", "size": 256}, "size": 256, "aesKeyString": "", "mode": "CBC"} |
| 137 | + release: |
| 138 | + name: st2ha |
| 139 | + asserts: |
| 140 | + - hasDocuments: |
| 141 | + count: 1 |
| 142 | + - equal: |
| 143 | + path: data.datastore_crypto_key |
| 144 | + value: "eyJobWFjS2V5IjogeyJobWFjS2V5U3RyaW5nIjogIiIsICJzaXplIjogMjU2fSwgInNpemUiOiAyNTYsICJhZXNLZXlTdHJpbmciOiAiIiwgIm1vZGUiOiAiQ0JDIn0=" # Base64 encoded value |
| 145 | + |
| 146 | + - it: ST2 Datastore Crypto Key Secret disable generation |
| 147 | + template: secrets_datastore_crypto_key.yaml |
| 148 | + set: |
| 149 | + st2: |
| 150 | + existingDatastoreSecret: "hello-world" |
| 151 | + release: |
| 152 | + name: st2ha |
| 153 | + asserts: |
| 154 | + - hasDocuments: |
| 155 | + count: 0 |
| 156 | + |
| 157 | + - it: ST2 Datastore Crypto Key Secret custom secret Name |
| 158 | + template: deployments.yaml |
| 159 | + set: |
| 160 | + st2: |
| 161 | + existingDatastoreSecret: "hello-world" |
| 162 | + st2chatops: |
| 163 | + enabled: true |
| 164 | + release: |
| 165 | + name: st2ha |
| 166 | + asserts: |
| 167 | + - hasDocuments: |
| 168 | + count: 14 |
| 169 | + - equal: |
| 170 | + path: metadata.name |
| 171 | + value: st2ha-st2api |
| 172 | + documentIndex: &deployment_st2api_doc 1 |
| 173 | + - equal: |
| 174 | + path: spec.template.spec.volumes[0].secret.secretName |
| 175 | + value: "hello-world" |
| 176 | + documentIndex: *deployment_st2api_doc |
| 177 | + - equal: |
| 178 | + path: metadata.name |
| 179 | + value: st2ha-st2rulesengine |
| 180 | + documentIndex: &deployment_st2rulesengine_doc 4 |
| 181 | + - equal: |
| 182 | + path: spec.template.spec.volumes[1].secret.secretName |
| 183 | + value: "hello-world" |
| 184 | + documentIndex: *deployment_st2rulesengine_doc |
| 185 | + - equal: |
| 186 | + path: metadata.name |
| 187 | + value: st2ha-st2workflowengine |
| 188 | + documentIndex: &deployment_st2workflowengine_doc 6 |
| 189 | + - equal: |
| 190 | + path: spec.template.spec.volumes[1].secret.secretName |
| 191 | + value: "hello-world" |
| 192 | + documentIndex: *deployment_st2workflowengine_doc |
| 193 | + - equal: |
| 194 | + path: metadata.name |
| 195 | + value: st2ha-st2scheduler |
| 196 | + documentIndex: &deployment_st2scheduler_doc 7 |
| 197 | + - equal: |
| 198 | + path: spec.template.spec.volumes[0].secret.secretName |
| 199 | + value: "hello-world" |
| 200 | + documentIndex: *deployment_st2scheduler_doc |
| 201 | + - equal: |
| 202 | + path: metadata.name |
| 203 | + value: st2ha-st2sensorcontainer |
| 204 | + documentIndex: &deployment_st2sensorcontainer_doc 9 |
| 205 | + - equal: |
| 206 | + path: spec.template.spec.volumes[0].secret.secretName |
| 207 | + value: "hello-world" |
| 208 | + documentIndex: *deployment_st2sensorcontainer_doc |
| 209 | + - equal: |
| 210 | + path: metadata.name |
| 211 | + value: st2ha-st2actionrunner |
| 212 | + documentIndex: &deployment_st2actionrunner_doc 10 |
| 213 | + - equal: |
| 214 | + path: spec.template.spec.volumes[0].secret.secretName |
| 215 | + value: "hello-world" |
| 216 | + documentIndex: *deployment_st2actionrunner_doc |
| 217 | + - equal: |
| 218 | + path: metadata.name |
| 219 | + value: st2ha-st2client |
| 220 | + documentIndex: &deployment_st2client_doc 12 |
| 221 | + - equal: |
| 222 | + path: spec.template.spec.volumes[0].secret.secretName |
| 223 | + value: "hello-world" |
| 224 | + documentIndex: *deployment_st2client_doc |
0 commit comments