@@ -129,72 +129,6 @@ ingress:
129129 ImportStateVerify : true ,
130130 ImportStateVerifyIgnore : []string {"wait" , "cascade" , "metadata.0.generation" , "metadata.0.resource_version" },
131131 },
132- {
133- Config : testAccArgoCDApplicationDirectory (
134- acctest .RandomWithPrefix ("test-acc" )),
135- Check : resource .ComposeTestCheckFunc (
136- resource .TestCheckResourceAttrSet (
137- "argocd_application.directory" ,
138- "metadata.0.uid" ,
139- ),
140- resource .TestCheckResourceAttr (
141- "argocd_application.directory" ,
142- "spec.0.source.0.directory.0.recurse" ,
143- "false" ,
144- ),
145- resource .TestCheckResourceAttr (
146- "argocd_application.directory" ,
147- "spec.0.source.0.directory.0.jsonnet.0.ext_var.0.name" ,
148- "somename" ,
149- ),
150- resource .TestCheckResourceAttr (
151- "argocd_application.directory" ,
152- "spec.0.source.0.directory.0.jsonnet.0.ext_var.0.value" ,
153- "somevalue" ,
154- ),
155- resource .TestCheckResourceAttr (
156- "argocd_application.directory" ,
157- "spec.0.source.0.directory.0.jsonnet.0.ext_var.0.code" ,
158- "false" ,
159- ),
160- resource .TestCheckResourceAttr (
161- "argocd_application.directory" ,
162- "spec.0.source.0.directory.0.jsonnet.0.ext_var.1.name" ,
163- "anothername" ,
164- ),
165- resource .TestCheckResourceAttr (
166- "argocd_application.directory" ,
167- "spec.0.source.0.directory.0.jsonnet.0.ext_var.1.value" ,
168- "anothervalue" ,
169- ),
170- resource .TestCheckResourceAttr (
171- "argocd_application.directory" ,
172- "spec.0.source.0.directory.0.jsonnet.0.ext_var.1.code" ,
173- "true" ,
174- ),
175- resource .TestCheckResourceAttr (
176- "argocd_application.directory" ,
177- "spec.0.source.0.directory.0.jsonnet.0.tla.0.name" ,
178- "yetanothername" ,
179- ),
180- resource .TestCheckResourceAttr (
181- "argocd_application.directory" ,
182- "spec.0.source.0.directory.0.jsonnet.0.tla.0.value" ,
183- "yetanothervalue" ,
184- ),
185- resource .TestCheckResourceAttr (
186- "argocd_application.directory" ,
187- "spec.0.source.0.directory.0.jsonnet.0.tla.0.code" ,
188- "true" ,
189- ),
190- ),
191- },
192- {
193- ResourceName : "argocd_application.directory" ,
194- ImportState : true ,
195- ImportStateVerify : true ,
196- ImportStateVerifyIgnore : []string {"wait" , "cascade" , "metadata.0.generation" , "metadata.0.resource_version" },
197- },
198132 {
199133 Config : testAccArgoCDApplicationSyncPolicy (
200134 acctest .RandomWithPrefix ("test-acc" )),
@@ -317,6 +251,91 @@ ingress:
317251 })
318252}
319253
254+ func TestAccArgoCDApplication_DirectoryJsonnet (t * testing.T ) {
255+ resource .ParallelTest (t , resource.TestCase {
256+ PreCheck : func () { testAccPreCheck (t ) },
257+ ProviderFactories : testAccProviders ,
258+ Steps : []resource.TestStep {
259+ {
260+ Config : testAccArgoCDApplication_DirectoryJsonnet (
261+ acctest .RandomWithPrefix ("test-acc" )),
262+ Check : resource .ComposeTestCheckFunc (
263+ resource .TestCheckResourceAttrSet (
264+ "argocd_application.directory" ,
265+ "metadata.0.uid" ,
266+ ),
267+ resource .TestCheckResourceAttr (
268+ "argocd_application.directory" ,
269+ "spec.0.source.0.directory.0.recurse" ,
270+ "false" ,
271+ ),
272+ resource .TestCheckResourceAttr (
273+ "argocd_application.directory" ,
274+ "spec.0.source.0.directory.0.jsonnet.0.ext_var.0.name" ,
275+ "somename" ,
276+ ),
277+ resource .TestCheckResourceAttr (
278+ "argocd_application.directory" ,
279+ "spec.0.source.0.directory.0.jsonnet.0.ext_var.0.value" ,
280+ "somevalue" ,
281+ ),
282+ resource .TestCheckResourceAttr (
283+ "argocd_application.directory" ,
284+ "spec.0.source.0.directory.0.jsonnet.0.ext_var.0.code" ,
285+ "false" ,
286+ ),
287+ resource .TestCheckResourceAttr (
288+ "argocd_application.directory" ,
289+ "spec.0.source.0.directory.0.jsonnet.0.ext_var.1.name" ,
290+ "anothername" ,
291+ ),
292+ resource .TestCheckResourceAttr (
293+ "argocd_application.directory" ,
294+ "spec.0.source.0.directory.0.jsonnet.0.ext_var.1.value" ,
295+ "anothervalue" ,
296+ ),
297+ resource .TestCheckResourceAttr (
298+ "argocd_application.directory" ,
299+ "spec.0.source.0.directory.0.jsonnet.0.ext_var.1.code" ,
300+ "true" ,
301+ ),
302+ resource .TestCheckResourceAttr (
303+ "argocd_application.directory" ,
304+ "spec.0.source.0.directory.0.jsonnet.0.tla.0.name" ,
305+ "yetanothername" ,
306+ ),
307+ resource .TestCheckResourceAttr (
308+ "argocd_application.directory" ,
309+ "spec.0.source.0.directory.0.jsonnet.0.tla.0.value" ,
310+ "yetanothervalue" ,
311+ ),
312+ resource .TestCheckResourceAttr (
313+ "argocd_application.directory" ,
314+ "spec.0.source.0.directory.0.jsonnet.0.tla.0.code" ,
315+ "true" ,
316+ ),
317+ resource .TestCheckResourceAttr (
318+ "argocd_application.directory" ,
319+ "spec.0.source.0.directory.0.jsonnet.0.libs.0" ,
320+ "vendor" ,
321+ ),
322+ resource .TestCheckResourceAttr (
323+ "argocd_application.directory" ,
324+ "spec.0.source.0.directory.0.jsonnet.0.libs.1" ,
325+ "foo" ,
326+ ),
327+ ),
328+ },
329+ {
330+ ResourceName : "argocd_application.directory" ,
331+ ImportState : true ,
332+ ImportStateVerify : true ,
333+ ImportStateVerifyIgnore : []string {"wait" , "cascade" , "metadata.0.generation" , "metadata.0.resource_version" },
334+ },
335+ },
336+ })
337+ }
338+
320339func TestAccArgoCDApplication_NoSyncPolicyBlock (t * testing.T ) {
321340 resource .ParallelTest (t , resource.TestCase {
322341 PreCheck : func () { testAccPreCheck (t ) },
@@ -1070,7 +1089,7 @@ resource "argocd_application" "directory" {
10701089 ` , name , path )
10711090}
10721091
1073- func testAccArgoCDApplicationDirectory (name string ) string {
1092+ func testAccArgoCDApplication_DirectoryJsonnet (name string ) string {
10741093 return fmt .Sprintf (`
10751094resource "argocd_application" "directory" {
10761095 metadata {
@@ -1104,6 +1123,10 @@ resource "argocd_application" "directory" {
11041123 value = "yetanothervalue"
11051124 code = true
11061125 }
1126+ libs = [
1127+ "vendor",
1128+ "foo"
1129+ ]
11071130 }
11081131 }
11091132 }
0 commit comments