diff options
author | Mat Schaffer <mat@schaffer.me> | 2018-07-27 17:17:26 +0900 |
---|---|---|
committer | Mat Schaffer <mat@schaffer.me> | 2018-07-27 17:17:26 +0900 |
commit | bc2bde6b20d0b6a7a0e1edd0b6a4e726c446d7c6 (patch) | |
tree | 9bfd0db7c306d7b79052a6323ecfc25ae5f07482 /statuscake/resource_statuscaketest.go | |
parent | ccc9fb69b8f1ebaaf871ad1561052d84a9ccd3a5 (diff) | |
download | terraform-provider-statuscake-bc2bde6b20d0b6a7a0e1edd0b6a4e726c446d7c6.tar.gz terraform-provider-statuscake-bc2bde6b20d0b6a7a0e1edd0b6a4e726c446d7c6.tar.zst terraform-provider-statuscake-bc2bde6b20d0b6a7a0e1edd0b6a4e726c446d7c6.zip |
Update test_tag handling to be a proper list of strings
Diffstat (limited to 'statuscake/resource_statuscaketest.go')
-rw-r--r-- | statuscake/resource_statuscaketest.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/statuscake/resource_statuscaketest.go b/statuscake/resource_statuscaketest.go index d7d3f36..866cdce 100644 --- a/statuscake/resource_statuscaketest.go +++ b/statuscake/resource_statuscaketest.go | |||
@@ -94,6 +94,7 @@ func resourceStatusCakeTest() *schema.Resource { | |||
94 | Optional: true, | 94 | Optional: true, |
95 | Default: 5, | 95 | Default: 5, |
96 | }, | 96 | }, |
97 | |||
97 | "custom_header": { | 98 | "custom_header": { |
98 | Type: schema.TypeString, | 99 | Type: schema.TypeString, |
99 | Optional: true, | 100 | Optional: true, |
@@ -178,8 +179,10 @@ func resourceStatusCakeTest() *schema.Resource { | |||
178 | }, | 179 | }, |
179 | 180 | ||
180 | "test_tags": { | 181 | "test_tags": { |
181 | Type: schema.TypeString, | 182 | Type: schema.TypeSet, |
183 | Elem: &schema.Schema{Type: schema.TypeString}, | ||
182 | Optional: true, | 184 | Optional: true, |
185 | Set: schema.HashString, | ||
183 | }, | 186 | }, |
184 | 187 | ||
185 | "status_codes": { | 188 | "status_codes": { |
@@ -240,7 +243,7 @@ func CreateTest(d *schema.ResourceData, meta interface{}) error { | |||
240 | FindString: d.Get("find_string").(string), | 243 | FindString: d.Get("find_string").(string), |
241 | DoNotFind: d.Get("do_not_find").(bool), | 244 | DoNotFind: d.Get("do_not_find").(bool), |
242 | RealBrowser: d.Get("real_browser").(int), | 245 | RealBrowser: d.Get("real_browser").(int), |
243 | TestTags: d.Get("test_tags").(string), | 246 | TestTags: castSetToSliceStrings(d.Get("test_tags").(*schema.Set).List()), |
244 | StatusCodes: d.Get("status_codes").(string), | 247 | StatusCodes: d.Get("status_codes").(string), |
245 | UseJar: d.Get("use_jar").(int), | 248 | UseJar: d.Get("use_jar").(int), |
246 | PostRaw: d.Get("post_raw").(string), | 249 | PostRaw: d.Get("post_raw").(string), |
@@ -417,7 +420,7 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test { | |||
417 | test.RealBrowser = v.(int) | 420 | test.RealBrowser = v.(int) |
418 | } | 421 | } |
419 | if v, ok := d.GetOk("test_tags"); ok { | 422 | if v, ok := d.GetOk("test_tags"); ok { |
420 | test.TestTags = v.(string) | 423 | test.TestTags = castSetToSliceStrings(v.(*schema.Set).List()) |
421 | } | 424 | } |
422 | if v, ok := d.GetOk("status_codes"); ok { | 425 | if v, ok := d.GetOk("status_codes"); ok { |
423 | test.StatusCodes = v.(string) | 426 | test.StatusCodes = v.(string) |