@@ -70,6 +70,32 @@ func TestAccNamespace_Basic(t *testing.T) {
7070 acctest .CheckResourceAttrUUID ("scaleway_container_namespace.main" , "id" ),
7171 ),
7272 },
73+ {
74+ Config : `
75+ resource scaleway_container_namespace main {
76+ name = "test-cr-ns-01"
77+ environment_variables = {
78+ "test" = "test"
79+ }
80+ secret_environment_variables = {
81+ "test_secret" = "test_secret"
82+ }
83+ tags = ["tag1", "tag2"]
84+ }
85+ ` ,
86+ Check : resource .ComposeTestCheckFunc (
87+ isNamespacePresent (tt , "scaleway_container_namespace.main" ),
88+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "description" , "" ),
89+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "name" , "test-cr-ns-01" ),
90+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "environment_variables.test" , "test" ),
91+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
92+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.#" , "2" ),
93+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.0" , "tag1" ),
94+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.1" , "tag2" ),
95+
96+ acctest .CheckResourceAttrUUID ("scaleway_container_namespace.main" , "id" ),
97+ ),
98+ },
7399 {
74100 Config : `
75101 resource scaleway_container_namespace main {
@@ -80,6 +106,7 @@ func TestAccNamespace_Basic(t *testing.T) {
80106 resource .TestCheckResourceAttrSet ("scaleway_container_namespace.main" , "name" ),
81107 resource .TestCheckResourceAttrSet ("scaleway_container_namespace.main" , "registry_endpoint" ),
82108 resource .TestCheckResourceAttrSet ("scaleway_container_namespace.main" , "registry_namespace_id" ),
109+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.#" , "0" ),
83110 ),
84111 },
85112 {
@@ -99,7 +126,7 @@ func TestAccNamespace_Basic(t *testing.T) {
99126 resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "name" , "tf-env-test" ),
100127 resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "environment_variables.test" , "test" ),
101128 resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
102-
129+ resource . TestCheckResourceAttr ( "scaleway_container_namespace.main" , "tags.#" , "0" ),
103130 acctest .CheckResourceAttrUUID ("scaleway_container_namespace.main" , "id" ),
104131 ),
105132 },
@@ -120,6 +147,23 @@ func TestAccNamespace_Basic(t *testing.T) {
120147 resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "name" , "tf-env-test" ),
121148 resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "environment_variables.foo" , "bar" ),
122149 resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.foo_secret" , "bar_secret" ),
150+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.#" , "0" ),
151+ acctest .CheckResourceAttrUUID ("scaleway_container_namespace.main" , "id" ),
152+ ),
153+ },
154+ {
155+ Config : `
156+ resource scaleway_container_namespace main {
157+ name = "tf-tags-test"
158+ tags = ["tag1", "tag2"]
159+ }
160+ ` ,
161+ Check : resource .ComposeTestCheckFunc (
162+ isNamespacePresent (tt , "scaleway_container_namespace.main" ),
163+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "name" , "tf-tags-test" ),
164+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.#" , "2" ),
165+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.0" , "tag1" ),
166+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.1" , "tag2" ),
123167
124168 acctest .CheckResourceAttrUUID ("scaleway_container_namespace.main" , "id" ),
125169 ),
0 commit comments