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

resource_arm_dns_mx_record: switch dependency from riviera to azure-sdk-for-go #185

Merged
merged 3 commits into from
Jul 26, 2017
Merged

resource_arm_dns_mx_record: switch dependency from riviera to azure-sdk-for-go #185

merged 3 commits into from
Jul 26, 2017

Conversation

sebastus
Copy link
Contributor

No description provided.

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a 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,
Copy link
Contributor

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, "", "")
Copy link
Contributor

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)
Copy link
Contributor

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?

Copy link
Contributor

@tombuildsstuff tombuildsstuff Jul 26, 2017

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
Copy link
Contributor

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?

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a 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!

@tombuildsstuff tombuildsstuff merged commit 9509d87 into hashicorp:master Jul 26, 2017
@ghost
Copy link

ghost commented Apr 1, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants