@@ -67,7 +67,7 @@ func TestAccNamespace_Basic(t *testing.T) {
67
67
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "description" , "" ),
68
68
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "name" , "test-cr-ns-01" ),
69
69
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "environment_variables.test" , "test" ),
70
- resource . TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
70
+ passwordMatchHash ("scaleway_container_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
71
71
72
72
acctest .CheckResourceAttrUUID ("scaleway_container_namespace.main" , "id" ),
73
73
),
@@ -90,7 +90,7 @@ func TestAccNamespace_Basic(t *testing.T) {
90
90
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "description" , "" ),
91
91
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "name" , "test-cr-ns-01" ),
92
92
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "environment_variables.test" , "test" ),
93
- resource . TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
93
+ passwordMatchHash ("scaleway_container_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
94
94
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.#" , "2" ),
95
95
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.0" , "tag1" ),
96
96
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.1" , "tag2" ),
@@ -127,7 +127,7 @@ func TestAccNamespace_Basic(t *testing.T) {
127
127
isNamespacePresent (tt , "scaleway_container_namespace.main" ),
128
128
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "name" , "tf-env-test" ),
129
129
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "environment_variables.test" , "test" ),
130
- resource . TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
130
+ passwordMatchHash ("scaleway_container_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
131
131
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.#" , "0" ),
132
132
acctest .CheckResourceAttrUUID ("scaleway_container_namespace.main" , "id" ),
133
133
),
@@ -148,7 +148,7 @@ func TestAccNamespace_Basic(t *testing.T) {
148
148
isNamespacePresent (tt , "scaleway_container_namespace.main" ),
149
149
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "name" , "tf-env-test" ),
150
150
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "environment_variables.foo" , "bar" ),
151
- resource . TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.foo_secret" , "bar_secret" ),
151
+ passwordMatchHash ("scaleway_container_namespace.main" , "secret_environment_variables.foo_secret" , "bar_secret" ),
152
152
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.#" , "0" ),
153
153
acctest .CheckResourceAttrUUID ("scaleway_container_namespace.main" , "id" ),
154
154
),
@@ -189,24 +189,14 @@ func TestAccNamespace_SecretManagement(t *testing.T) {
189
189
name = "test-secret-ns"
190
190
secret_environment_variables = {
191
191
"SECRET_1" = "value1"
192
+ "SECRET_2" = "value2"
192
193
}
193
194
}
194
195
` ,
195
196
Check : resource .ComposeTestCheckFunc (
196
197
isNamespacePresent (tt , "scaleway_container_namespace.main" ),
197
- resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_1" , "value1" ),
198
- ),
199
- },
200
- {
201
- Config : `
202
- resource scaleway_container_namespace main {
203
- name = "test-secret-ns"
204
- secret_environment_variables = {}
205
- }
206
- ` ,
207
- Check : resource .ComposeTestCheckFunc (
208
- isNamespacePresent (tt , "scaleway_container_namespace.main" ),
209
- resource .TestCheckNoResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_1" ),
198
+ passwordMatchHash ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_1" , "value1" ),
199
+ passwordMatchHash ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_2" , "value2" ),
210
200
),
211
201
},
212
202
{
@@ -215,44 +205,31 @@ func TestAccNamespace_SecretManagement(t *testing.T) {
215
205
name = "test-secret-ns"
216
206
secret_environment_variables = {
217
207
"SECRET_1" = "value1"
218
- "SECRET_2" = "value2 "
208
+ "SECRET_2" = "updated_value2 "
219
209
}
220
210
}
221
211
` ,
222
212
Check : resource .ComposeTestCheckFunc (
223
213
isNamespacePresent (tt , "scaleway_container_namespace.main" ),
224
- resource . TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_1" , "value1" ),
225
- resource . TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_2" , "value2 " ),
214
+ passwordMatchHash ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_1" , "value1" ),
215
+ passwordMatchHash ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_2" , "updated_value2 " ),
226
216
),
227
217
},
228
218
{
229
219
Config : `
230
220
resource scaleway_container_namespace main {
231
221
name = "test-secret-ns"
232
222
secret_environment_variables = {
233
- "SECRET_2" = "value2"
223
+ "SECRET_KEY_1" = "value1"
224
+ "SECRET_2" = "updated_value2"
234
225
}
235
226
}
236
227
` ,
237
228
Check : resource .ComposeTestCheckFunc (
238
229
isNamespacePresent (tt , "scaleway_container_namespace.main" ),
230
+ passwordMatchHash ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_KEY_1" , "value1" ),
239
231
resource .TestCheckNoResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_1" ),
240
- resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_2" , "value2" ),
241
- ),
242
- },
243
- {
244
- Config : `
245
- resource scaleway_container_namespace main {
246
- name = "test-secret-ns"
247
- secret_environment_variables = {
248
- "SECRET_3" = "value3"
249
- }
250
- }
251
- ` ,
252
- Check : resource .ComposeTestCheckFunc (
253
- isNamespacePresent (tt , "scaleway_container_namespace.main" ),
254
- resource .TestCheckNoResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_2" ),
255
- resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_3" , "value3" ),
232
+ passwordMatchHash ("scaleway_container_namespace.main" , "secret_environment_variables.SECRET_2" , "updated_value2" ),
256
233
),
257
234
},
258
235
},
0 commit comments