Skip to content

Commit

Permalink
fix: ATTRIBUTE set(string) parsing for cortex search service (#2953)
Browse files Browse the repository at this point in the history
Fixes the issue pointed out in
#2860 (comment)

Verified in my local deployment

PTAL @sfc-gh-asawicki @sfc-gh-mloring
  • Loading branch information
chris-codaio authored Jul 23, 2024
1 parent 1127bb3 commit 70a1c9a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/resources/cortex_search_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/cortex_search_service_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ variable "on" {
}

variable "attributes" {
type = list(string)
type = set(string)
}

variable "database" {
Expand Down

0 comments on commit 70a1c9a

Please sign in to comment.