Skip to content

Commit

Permalink
[fix] pipe copy statement diff (Snowflake-Labs#184)
Browse files Browse the repository at this point in the history
Is this an acceptable fix for comparing multi-line `copy_statement`s in the pipe resource. Tested it locally in our dev snowflake environment, it seems to not detect changes anymore.

## References
* Potential fix for Snowflake-Labs#180 

[Travis build](https://travis-ci.com/github/henriblancke/terraform-provider-snowflake/builds/162804020)
  • Loading branch information
henriblancke authored Apr 30, 2020
1 parent f603d62 commit 5b558c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/resources/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ var pipeSchema = map[string]*schema.Schema{
Required: true,
ForceNew: true,
Description: "Specifies the copy statement for the pipe.",
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
if strings.TrimSuffix(old, "\n") == strings.TrimSuffix(new, "\n") {
return true
}
return false
},
},
"auto_ingest": &schema.Schema{
Type: schema.TypeBool,
Expand Down Expand Up @@ -338,6 +344,5 @@ func showPipe(db *sql.DB, query string) (showPipeResult, error) {
if err != nil {
return r, err
}

return r, nil
}

0 comments on commit 5b558c8

Please sign in to comment.