-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
resource_arm_dns_ns_record: switch dependency from riviera to azure-sdk-for-go #179
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!
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) |
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 I think this should be NSRecord
? :)
if err != nil { | ||
return fmt.Errorf("Bad: GetNSRecordSet: %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.
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, "", "") |
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 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, | ||
} |
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 move this into the parameters
assignment below?
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 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!
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.