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_ns_record: switch dependency from riviera to azure-sdk-for-go #179

Merged
merged 5 commits into from
Jul 26, 2017
Merged

resource_arm_dns_ns_record: switch dependency from riviera to azure-sdk-for-go #179

merged 5 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!

if readResponse.IsSuccessful() {
return fmt.Errorf("Bad: DNS NS Record still exists: %s", readResponse.Error)
if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("DNS MSNSecord still exists:\n%#v", resp.RecordSetProperties)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor I think this should be NSRecord? :)

if err != nil {
return fmt.Errorf("Bad: GetNSRecordSet: %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.

same as the other PR's - I think we should be checking a 404 above this, and then returning if there's an error?

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.NS, 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 option for here? generally when there's more than one empty argument we'd tend to separate these out into variables above, i.e.:

foo := "bar"
bar := "foo"
...CreateOrUpdate(...., foo, bar)

props := dns.RecordSetProperties{
Metadata: metadata,
TTL: &ttl,
NsRecords: &records,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move this into the parameters assignment below?

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 TestAccAzureRMDnsNs
=== RUN   TestAccAzureRMDnsNsRecord_importBasic
--- PASS: TestAccAzureRMDnsNsRecord_importBasic (83.33s)
=== RUN   TestAccAzureRMDnsNsRecord_importWithTags
--- PASS: TestAccAzureRMDnsNsRecord_importWithTags (79.66s)
=== RUN   TestAccAzureRMDnsNsRecord_basic
--- PASS: TestAccAzureRMDnsNsRecord_basic (61.82s)
=== RUN   TestAccAzureRMDnsNsRecord_updateRecords
--- PASS: TestAccAzureRMDnsNsRecord_updateRecords (89.94s)
=== RUN   TestAccAzureRMDnsNsRecord_withTags
--- PASS: TestAccAzureRMDnsNsRecord_withTags (87.97s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	402.741s

Thanks!

@tombuildsstuff tombuildsstuff merged commit 3499fd1 into hashicorp:master Jul 26, 2017
@sebastus sebastus deleted the resource_arm_dns_ns_record branch September 6, 2017 21:36
@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