@@ -70,6 +70,32 @@ func TestAccNamespace_Basic(t *testing.T) {
70
70
acctest .CheckResourceAttrUUID ("scaleway_container_namespace.main" , "id" ),
71
71
),
72
72
},
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
+ },
73
99
{
74
100
Config : `
75
101
resource scaleway_container_namespace main {
@@ -80,6 +106,7 @@ func TestAccNamespace_Basic(t *testing.T) {
80
106
resource .TestCheckResourceAttrSet ("scaleway_container_namespace.main" , "name" ),
81
107
resource .TestCheckResourceAttrSet ("scaleway_container_namespace.main" , "registry_endpoint" ),
82
108
resource .TestCheckResourceAttrSet ("scaleway_container_namespace.main" , "registry_namespace_id" ),
109
+ resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "tags.#" , "0" ),
83
110
),
84
111
},
85
112
{
@@ -99,7 +126,7 @@ func TestAccNamespace_Basic(t *testing.T) {
99
126
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "name" , "tf-env-test" ),
100
127
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "environment_variables.test" , "test" ),
101
128
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "secret_environment_variables.test_secret" , "test_secret" ),
102
-
129
+ resource . TestCheckResourceAttr ( "scaleway_container_namespace.main" , "tags.#" , "0" ),
103
130
acctest .CheckResourceAttrUUID ("scaleway_container_namespace.main" , "id" ),
104
131
),
105
132
},
@@ -120,6 +147,23 @@ func TestAccNamespace_Basic(t *testing.T) {
120
147
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "name" , "tf-env-test" ),
121
148
resource .TestCheckResourceAttr ("scaleway_container_namespace.main" , "environment_variables.foo" , "bar" ),
122
149
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" ),
123
167
124
168
acctest .CheckResourceAttrUUID ("scaleway_container_namespace.main" , "id" ),
125
169
),
0 commit comments