-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Warehouse redesign part1 (#2864)
First part o warehouse redesign: - warehouse sizes fixed - defaults removed - additional conditional logic removed - parameters fixed - state upgrader added (not for all yet) - show output an parameters output added - additional logic for not working unsets added Common: - added multiple planchecks - added import checks - added snowflake checks - proposed how we can deal with SF defaults with optional (non-computed) attributes; we will decide between the two approaches soon What's missing: - datasource - state upgraders for all fields - some acceptance and integration tests - possibility to suspend warehouse before update
- Loading branch information
1 parent
269df6b
commit 6664457
Showing
37 changed files
with
2,866 additions
and
668 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package importchecks | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/hashicorp/terraform-plugin-testing/helper/resource" | ||
"github.com/hashicorp/terraform-plugin-testing/terraform" | ||
) | ||
|
||
// ComposeImportStateCheck is based on unexported composeImportStateCheck from teststep_providers_test.go | ||
func ComposeImportStateCheck(fs ...resource.ImportStateCheckFunc) resource.ImportStateCheckFunc { | ||
return func(s []*terraform.InstanceState) error { | ||
for i, f := range fs { | ||
if err := f(s); err != nil { | ||
return fmt.Errorf("check %d/%d error: %w", i+1, len(fs), err) | ||
} | ||
} | ||
return nil | ||
} | ||
} | ||
|
||
// TestCheckResourceAttrInstanceState is based on unexported testCheckResourceAttrInstanceState from teststep_providers_test.go | ||
func TestCheckResourceAttrInstanceState(id string, attributeName, attributeValue string) resource.ImportStateCheckFunc { | ||
return func(is []*terraform.InstanceState) error { | ||
for _, v := range is { | ||
if v.ID != id { | ||
continue | ||
} | ||
|
||
if attrVal, ok := v.Attributes[attributeName]; ok { | ||
if attrVal != attributeValue { | ||
return fmt.Errorf("expected: %s got: %s", attributeValue, attrVal) | ||
} | ||
|
||
return nil | ||
} | ||
} | ||
|
||
return fmt.Errorf("attribute %s not found in instance state", attributeName) | ||
} | ||
} |
Oops, something went wrong.