From 2060379ff2ed7c80be6914ee679f076c3e32955f Mon Sep 17 00:00:00 2001 From: Christopher Eck Date: Mon, 22 Jul 2024 14:20:12 -0700 Subject: [PATCH] Fix ATTRIBUTE set(string) parsing for cortex search service --- pkg/resources/cortex_search_service.go | 4 ++-- pkg/resources/cortex_search_service_acceptance_test.go | 2 +- .../testdata/TestAcc_CortexSearchService_basic/2/variables.tf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/resources/cortex_search_service.go b/pkg/resources/cortex_search_service.go index 8ec3d7ca0e..bcba7ea224 100644 --- a/pkg/resources/cortex_search_service.go +++ b/pkg/resources/cortex_search_service.go @@ -147,9 +147,9 @@ func CreateCortexSearchService(ctx context.Context, d *schema.ResourceData, meta if v, ok := d.GetOk("comment"); ok { request.WithComment(v.(string)) } - if v, ok := d.GetOk("attributes"); ok && len(v.([]string)) > 0 { + if v, ok := d.GetOk("attributes"); ok && len(v.(*schema.Set).List()) > 0 { attributes := sdk.AttributesRequest{ - Columns: v.([]string), + Columns: expandStringList(v.(*schema.Set).List()), } request.WithAttributes(attributes) } diff --git a/pkg/resources/cortex_search_service_acceptance_test.go b/pkg/resources/cortex_search_service_acceptance_test.go index de81435b9f..8fba481276 100644 --- a/pkg/resources/cortex_search_service_acceptance_test.go +++ b/pkg/resources/cortex_search_service_acceptance_test.go @@ -32,7 +32,7 @@ func TestAcc_CortexSearchService_basic(t *testing.T) { } } variableSet2 := m() - variableSet2["attributes"] = config.ListVariable(config.StringVariable("type")) + variableSet2["attributes"] = config.SetVariable(config.StringVariable("type")) variableSet2["warehouse"] = config.StringVariable(newWarehouseName) variableSet2["comment"] = config.StringVariable("Terraform acceptance test - updated") diff --git a/pkg/resources/testdata/TestAcc_CortexSearchService_basic/2/variables.tf b/pkg/resources/testdata/TestAcc_CortexSearchService_basic/2/variables.tf index e74b1a90a2..2287d89e7a 100644 --- a/pkg/resources/testdata/TestAcc_CortexSearchService_basic/2/variables.tf +++ b/pkg/resources/testdata/TestAcc_CortexSearchService_basic/2/variables.tf @@ -9,7 +9,7 @@ variable "on" { } variable "attributes" { - type = list(string) + type = set(string) } variable "database" {