-
Notifications
You must be signed in to change notification settings - Fork 381
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
Support multi_compute field in log_query #629
Conversation
This adds support for the `multi_compute` field alternative to the `compute` one. Closes #628
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Looks mostly good, but I left couple comments inline to address.
@@ -4713,7 +4713,27 @@ func getApmLogNetworkRumSecurityQuerySchema() *schema.Schema { | |||
}, | |||
"compute": { |
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.
Since compute
and multi_compute
are mutually exclusive (as per the docs below), should we mark them with ConflictsWith
? (see it's doc under https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/schema#Schema)
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.
Hmm, actually after re-reading this I'm not sure. Are they mutually exclusive or can they coexist?
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.
AFAIK you can't use ConflictsWith
inside lists or maps.
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.
Ah, that's right. So we're basically relying on the API to return the proper error message if both are used, right?
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.
Yeah I added a TODO below, but I need to change 5 different functions to propagate errors :/
Required: true, | ||
Optional: true, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ |
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.
This Schema definition seems the same as the one for multi_compute
AFAICS. Would it make sense to create a function to return it instead of duplicating it?
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.
We could. The schema for compute
is actually useless because it's a TypeMap
, but it doesn't hurt.
dffb6f9
to
ef42256
Compare
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.
LGTM now. As for the mutual exclusivity of compute
and multi_compute
, I think it's ok to rely on API to return a proper error message and not check it in the code for now.
This adds support for the
multi_compute
field alternative to thecompute
one.Closes #628