Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 0.84 release #2374

Merged
merged 7 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/resources/resource_monitor_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestAcc_ResourceMonitorChangeStartEndTimestamp(t *testing.T) {
func resourceMonitorConfigUpdatedTimestamp(accName string) string {
return fmt.Sprintf(`
resource "snowflake_warehouse" "warehouse" {
name = "test"
name = "test%v"
comment = "foo"
warehouse_size = "XSMALL"
}
Expand All @@ -119,7 +119,7 @@ resource "snowflake_resource_monitor" "test" {
end_timestamp = "2056-01-01 12:00"

}
`, accName)
`, accName, accName)
}

// fix 2 added empy notifiy user
Expand Down
10 changes: 4 additions & 6 deletions pkg/resources/table_constraint.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"log"
"strings"

"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/snowflake"
snowflakeValidation "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/validation"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand All @@ -33,11 +32,10 @@ var tableConstraintSchema = map[string]*schema.Schema{
},
},
"table_id": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: "Idenfifier for table to create constraint on. Must be of the form Note: format must follow: \"<db_name>\".\"<schema_name>\".\"<table_name>\" or \"<db_name>.<schema_name>.<table_name>\" or \"<db_name>|<schema_name>.<table_name>\" (snowflake_table.my_table.id)",
ValidateDiagFunc: IsValidIdentifier[sdk.SchemaObjectIdentifier](),
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: "Idenfifier for table to create constraint on. Must be of the form Note: format must follow: \"<db_name>\".\"<schema_name>\".\"<table_name>\" or \"<db_name>.<schema_name>.<table_name>\" or \"<db_name>|<schema_name>.<table_name>\" (snowflake_table.my_table.id)",
},
"columns": {
Type: schema.TypeList,
Expand Down
10 changes: 4 additions & 6 deletions pkg/resources/tag_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"

"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/snowflake"
snowflakeValidation "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/validation"
)
Expand Down Expand Up @@ -65,11 +64,10 @@ var tagAssociationSchema = map[string]*schema.Schema{
ForceNew: true,
},
"tag_id": {
Type: schema.TypeString,
Required: true,
Description: "Specifies the identifier for the tag. Note: format must follow: \"databaseName\".\"schemaName\".\"tagName\" or \"databaseName.schemaName.tagName\" or \"databaseName|schemaName.tagName\" (snowflake_tag.tag.id)",
ValidateDiagFunc: IsValidIdentifier[sdk.SchemaObjectIdentifier](),
ForceNew: true,
Type: schema.TypeString,
Required: true,
Description: "Specifies the identifier for the tag. Note: format must follow: \"databaseName\".\"schemaName\".\"tagName\" or \"databaseName.schemaName.tagName\" or \"databaseName|schemaName.tagName\" (snowflake_tag.tag.id)",
ForceNew: true,
},
"tag_value": {
Type: schema.TypeString,
Expand Down
9 changes: 4 additions & 5 deletions pkg/resources/tag_masking_policy_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ const (

var mpAttachmentPolicySchema = map[string]*schema.Schema{
"tag_id": {
Type: schema.TypeString,
Required: true,
Description: "Specifies the identifier for the tag. Note: format must follow: \"databaseName\".\"schemaName\".\"tagName\" or \"databaseName.schemaName.tagName\" or \"databaseName|schemaName.tagName\" (snowflake_tag.tag.id)",
ValidateDiagFunc: IsValidIdentifier[sdk.SchemaObjectIdentifier](),
ForceNew: true,
Type: schema.TypeString,
Required: true,
Description: "Specifies the identifier for the tag. Note: format must follow: \"databaseName\".\"schemaName\".\"tagName\" or \"databaseName.schemaName.tagName\" or \"databaseName|schemaName.tagName\" (snowflake_tag.tag.id)",
ForceNew: true,
},
"masking_policy_id": {
Type: schema.TypeString,
Expand Down
6 changes: 5 additions & 1 deletion pkg/sdk/sweepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ func getDatabaseSweeper(client *Client, prefix string) func() error {
if (prefix == "" || strings.HasPrefix(db.Name, prefix)) && db.Name != "SNOWFLAKE" && db.Name != "terraform_test_database" {
log.Printf("[DEBUG] Dropping database %s", db.Name)
if err := client.Databases.Drop(ctx, db.ID(), nil); err != nil {
return err
if strings.Contains(err.Error(), "Object found is of type 'APPLICATION', not specified type 'DATABASE'") {
log.Printf("[DEBUG] Skipping database %s", db.Name)
} else {
return err
}
}
} else {
log.Printf("[DEBUG] Skipping database %s", db.Name)
Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/application_packages_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func TestInt_ApplicationPackagesVersionAndReleaseDirective(t *testing.T) {
createApplicationPackageHandle := func(t *testing.T) *sdk.ApplicationPackage {
t.Helper()

id := sdk.NewAccountObjectIdentifier("snowflake_package_test")
id := sdk.RandomAccountObjectIdentifier()
request := sdk.NewCreateApplicationPackageRequest(id).WithDistribution(sdk.DistributionPointer(sdk.DistributionInternal))
err := client.ApplicationPackages.Create(ctx, request)
require.NoError(t, err)
Expand Down
Loading