-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
resource_arm_dns_mx_record: switch dependency from riviera to azure-sdk-for-go #185
resource_arm_dns_mx_record: switch dependency from riviera to azure-sdk-for-go #185
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.
Hey @sebastus
Thanks for this PR - I've taken a look and left some comments in-line - but this is off to a good start :)
Thanks!
props := dns.RecordSetProperties{ | ||
Metadata: metadata, | ||
TTL: &ttl, | ||
MxRecords: &records, |
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.
minor can we combine this into the properties
assignment below?
readResponse, err := readRequest.Execute() | ||
//last parameter is set to empty to allow updates to records after creation | ||
// (per SDK, set it to '*' to prevent updates, all other values are ignored) | ||
resp, err := dnsClient.CreateOrUpdate(resGroup, zoneName, name, dns.MX, parameters, "", "") |
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.
what's the penultimate argument for here? in general we'd tend to assign the values to variables when there's multiple default values, so that it's clear what the values are
for i, v := range recordStrings { | ||
mxrecord := v.(map[string]interface{}) | ||
preference := mxrecord["preference"].(string) | ||
i64, _ := strconv.ParseInt(preference, 10, 32) |
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.
I think we should be able to update the schema and the set to be an int
here - and then remove the strconv
parse here?
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.
added a TODO for this here
if err != nil { | ||
return fmt.Errorf("Bad: GetMXRecordSet: %s", err) | ||
return nil |
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.
I think we should be checking for the 404 above this, and then returning the error if it's present here?
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.
Hey @sebastus
Thanks for this contribution - due to changes within Azure detailed in #192 in order for us to merge this change in I've push a commit which contains fixes for the outstanding comments.
Your contribution is still included (and still credited to you), with the appropriate modifications. Feel free to ask about any of the changes.
Tests pass:
$ TF_ACC=1 envchain azurerm go test ./azurerm -v -timeout 120m -run TestAccAzureRMDnsMx
=== RUN TestAccAzureRMDnsMxRecord_importBasic
--- PASS: TestAccAzureRMDnsMxRecord_importBasic (89.26s)
=== RUN TestAccAzureRMDnsMxRecord_importWithTags
--- PASS: TestAccAzureRMDnsMxRecord_importWithTags (85.37s)
=== RUN TestAccAzureRMDnsMxRecord_basic
--- PASS: TestAccAzureRMDnsMxRecord_basic (88.19s)
=== RUN TestAccAzureRMDnsMxRecord_updateRecords
--- PASS: TestAccAzureRMDnsMxRecord_updateRecords (92.76s)
=== RUN TestAccAzureRMDnsMxRecord_withTags
--- PASS: TestAccAzureRMDnsMxRecord_withTags (95.54s)
PASS
ok github.com/terraform-providers/terraform-provider-azurerm/azurerm 451.153s
Thanks!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
No description provided.