@@ -293,6 +293,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
293
293
type = string
294
294
default = "2"
295
295
}
296
+ data "coder_parameter" "unrelated" {
297
+ name = "unrelated"
298
+ type = "string"
299
+ default = join("", ["a", "b"])
300
+ }
296
301
resource "null_resource" "test" {}` ,
297
302
},
298
303
wantTags : map [string ]string {"owner" : "" , "scope" : "organization" },
@@ -301,18 +306,23 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
301
306
name : "main.tf with empty workspace tags" ,
302
307
files : map [string ]string {
303
308
`main.tf` : `
304
- variable "a" {
305
- type = string
306
- default = "1"
307
- }
308
- data "coder_parameter" "b" {
309
- type = string
310
- default = "2"
311
- }
312
- resource "null_resource" "test" {}
313
- data "coder_workspace_tags" "tags" {
314
- tags = {}
315
- }` ,
309
+ variable "a" {
310
+ type = string
311
+ default = "1"
312
+ }
313
+ data "coder_parameter" "b" {
314
+ type = string
315
+ default = "2"
316
+ }
317
+ data "coder_parameter" "unrelated" {
318
+ name = "unrelated"
319
+ type = "string"
320
+ default = join("", ["a", "b"])
321
+ }
322
+ resource "null_resource" "test" {}
323
+ data "coder_workspace_tags" "tags" {
324
+ tags = {}
325
+ }` ,
316
326
},
317
327
wantTags : map [string ]string {"owner" : "" , "scope" : "organization" },
318
328
},
@@ -328,6 +338,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
328
338
type = string
329
339
default = "2"
330
340
}
341
+ data "coder_parameter" "unrelated" {
342
+ name = "unrelated"
343
+ type = "string"
344
+ default = join("", ["a", "b"])
345
+ }
331
346
resource "null_resource" "test" {}
332
347
data "coder_workspace_tags" "tags" {
333
348
tags = {
@@ -343,22 +358,27 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
343
358
name : "main.tf with workspace tags and request tags" ,
344
359
files : map [string ]string {
345
360
`main.tf` : `
346
- variable "a" {
347
- type = string
348
- default = "1"
349
- }
350
- data "coder_parameter" "b" {
351
- type = string
352
- default = "2"
353
- }
354
- resource "null_resource" "test" {}
355
- data "coder_workspace_tags" "tags" {
356
- tags = {
357
- "foo": "bar",
358
- "a": var.a,
359
- "b": data.coder_parameter.b.value,
361
+ variable "a" {
362
+ type = string
363
+ default = "1"
360
364
}
361
- }` ,
365
+ data "coder_parameter" "b" {
366
+ type = string
367
+ default = "2"
368
+ }
369
+ data "coder_parameter" "unrelated" {
370
+ name = "unrelated"
371
+ type = "string"
372
+ default = join("", ["a", "b"])
373
+ }
374
+ resource "null_resource" "test" {}
375
+ data "coder_workspace_tags" "tags" {
376
+ tags = {
377
+ "foo": "bar",
378
+ "a": var.a,
379
+ "b": data.coder_parameter.b.value,
380
+ }
381
+ }` ,
362
382
},
363
383
reqTags : map [string ]string {"baz" : "zap" , "foo" : "noclobber" },
364
384
wantTags : map [string ]string {"owner" : "" , "scope" : "organization" , "foo" : "bar" , "baz" : "zap" , "a" : "1" , "b" : "2" },
@@ -375,6 +395,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
375
395
type = string
376
396
default = "2"
377
397
}
398
+ data "coder_parameter" "unrelated" {
399
+ name = "unrelated"
400
+ type = "string"
401
+ default = join("", ["a", "b"])
402
+ }
378
403
resource "null_resource" "test" {
379
404
name = "foo"
380
405
}
@@ -401,6 +426,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
401
426
type = string
402
427
default = "2"
403
428
}
429
+ data "coder_parameter" "unrelated" {
430
+ name = "unrelated"
431
+ type = "string"
432
+ default = join("", ["a", "b"])
433
+ }
404
434
resource "null_resource" "test" {
405
435
name = "foo"
406
436
}
@@ -423,6 +453,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
423
453
name : "main.tf with workspace tags that attempts to set user scope" ,
424
454
files : map [string ]string {
425
455
`main.tf` : `
456
+ data "coder_parameter" "unrelated" {
457
+ name = "unrelated"
458
+ type = "string"
459
+ default = join("", ["a", "b"])
460
+ }
426
461
resource "null_resource" "test" {}
427
462
data "coder_workspace_tags" "tags" {
428
463
tags = {
@@ -437,6 +472,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
437
472
name : "main.tf with workspace tags that attempt to clobber org ID" ,
438
473
files : map [string ]string {
439
474
`main.tf` : `
475
+ data "coder_parameter" "unrelated" {
476
+ name = "unrelated"
477
+ type = "string"
478
+ default = join("", ["a", "b"])
479
+ }
440
480
resource "null_resource" "test" {}
441
481
data "coder_workspace_tags" "tags" {
442
482
tags = {
@@ -451,6 +491,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
451
491
name : "main.tf with workspace tags that set scope=user" ,
452
492
files : map [string ]string {
453
493
`main.tf` : `
494
+ data "coder_parameter" "unrelated" {
495
+ name = "unrelated"
496
+ type = "string"
497
+ default = join("", ["a", "b"])
498
+ }
454
499
resource "null_resource" "test" {}
455
500
data "coder_workspace_tags" "tags" {
456
501
tags = {
@@ -465,11 +510,10 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
465
510
name : "main.tf with no workspace_tags and a function call in a parameter default" ,
466
511
files : map [string ]string {
467
512
`main.tf` : `
468
- data "coder_parameter" "foo " {
469
- name = "foo "
513
+ data "coder_parameter" "unrelated " {
514
+ name = "unrelated "
470
515
type = "list(string)"
471
516
default = jsonencode(["1", "2", "3", "4"])
472
- mutable = true
473
517
}` ,
474
518
},
475
519
wantTags : map [string ]string {"owner" : "" , "scope" : "organization" },
0 commit comments