-
Notifications
You must be signed in to change notification settings - Fork 16
Initial work on Query command for List Resource #531
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rainkwan, left a few minor comments but nothing that I think blocks us from merging this. LGTM 🚗
|
||
r.UnitTest(t, r.TestCase{ | ||
TerraformVersionChecks: []tfversion.TerraformVersionCheck{ | ||
tfversion.SkipBelow(tfversion.Version1_14_0), // Query mode requires Terraform 1.13.0 or later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this comment since it contradicts what's in the code
tfversion.SkipBelow(tfversion.Version1_14_0), // Query mode requires Terraform 1.13.0 or later | |
tfversion.SkipBelow(tfversion.Version1_14_0), |
|
||
for _, file := range fi { | ||
if file.Mode().IsRegular() { | ||
if filepath.Ext(file.Name()) == ".warioform" || filepath.Ext(file.Name()) == ".json" || filepath.Ext(file.Name()) == ".hcl" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it makes sense to be more specific with the file extension here as well, also
.warioform
😬
if filepath.Ext(file.Name()) == ".warioform" || filepath.Ext(file.Name()) == ".json" || filepath.Ext(file.Name()) == ".hcl" { | |
if filepath.Ext(file.Name()) == ".warioform" || filepath.Ext(file.Name()) == ".json" || filepath.Ext(file.Name()) == ".tfquery.hcl" { |
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/provider" | ||
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/resource" | ||
) | ||
|
||
var _ tfprotov6.ProviderServer = ProviderServer{} | ||
|
||
// var _ tfprotov6.ProviderServerWithListResource = ProviderServer{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this still be commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally speaking, this interface should only be directly referenced by exported terraform-plugin-go
packages or testing packages like in terraform-plugin-mux
Since it's a temporary interface, we will eventually remove it once all downstream provider servers have a chance to implement them (for example, SDKv2 will need to implement the interface eventually, even if it doesn't have an SDK for the RPCs). Once that is removed, since there are no direct references to the interface itself, no downstream packages need to be re-released with the interface removed and provider's CI won't break 🙂
@@ -71,6 +71,10 @@ func (c configurationFile) HasTerraformBlock(ctx context.Context) (bool, error) | |||
return contains, nil | |||
} | |||
|
|||
func (c configurationFile) WriteQuery(ctx context.Context, dest string) error { | |||
panic("WriteQuery not supported for configurationDirectory") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
panic("WriteQuery not supported for configurationDirectory") | |
panic("WriteQuery not supported for configurationFile") |
Related Issue
Building off #528
Description
Adding ListResource and ValidateListResourceConfig from List Resource to plugin testing.
Rollback Plan
Changes to Security Controls
No