@@ -68,7 +68,7 @@ func TestAccFunctionNamespace_Basic(t *testing.T) {
6868 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "description" , "" ),
6969 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "name" , "test-cr-ns-01" ),
7070 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "environment_variables.test" , "test" ),
71- resource . TestCheckResourceAttr ("scaleway_function_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
71+ passwordMatchHash ("scaleway_function_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
7272 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "tags.#" , "0" ),
7373
7474 acctest .CheckResourceAttrUUID ("scaleway_function_namespace.main" , "id" ),
@@ -92,7 +92,7 @@ func TestAccFunctionNamespace_Basic(t *testing.T) {
9292 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "description" , "" ),
9393 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "name" , "test-cr-ns-01" ),
9494 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "environment_variables.test" , "test" ),
95- resource . TestCheckResourceAttr ("scaleway_function_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
95+ passwordMatchHash ("scaleway_function_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
9696 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "tags.#" , "2" ),
9797 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "tags.0" , "tag1" ),
9898 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "tags.1" , "tag2" ),
@@ -142,13 +142,16 @@ func TestAccFunctionNamespace_EnvironmentVariables(t *testing.T) {
142142 environment_variables = {
143143 "test" = "test"
144144 }
145+ secret_environment_variables = {
146+ "test_secret" = "test_secret"
147+ }
145148 }
146149 ` ,
147150 Check : resource .ComposeTestCheckFunc (
148151 testAccCheckFunctionNamespaceExists (tt , "scaleway_function_namespace.main" ),
149152 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "name" , "tf-env-test" ),
150153 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "environment_variables.test" , "test" ),
151-
154+ passwordMatchHash ( "scaleway_function_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
152155 acctest .CheckResourceAttrUUID ("scaleway_function_namespace.main" , "id" ),
153156 ),
154157 },
@@ -159,13 +162,16 @@ func TestAccFunctionNamespace_EnvironmentVariables(t *testing.T) {
159162 environment_variables = {
160163 "foo" = "bar"
161164 }
165+ secret_environment_variables = {
166+ "test_secret" = "updated_secret"
167+ }
162168 }
163169 ` ,
164170 Check : resource .ComposeTestCheckFunc (
165171 testAccCheckFunctionNamespaceExists (tt , "scaleway_function_namespace.main" ),
166172 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "name" , "tf-env-test" ),
167173 resource .TestCheckResourceAttr ("scaleway_function_namespace.main" , "environment_variables.foo" , "bar" ),
168-
174+ passwordMatchHash ( "scaleway_function_namespace.main" , "secret_environment_variables.test_secret" , "updated_secret" ),
169175 acctest .CheckResourceAttrUUID ("scaleway_function_namespace.main" , "id" ),
170176 ),
171177 },
0 commit comments