Skip to content

Commit

Permalink
provider/azurerm: azurerm_dns_zone now returns name_servers
Browse files Browse the repository at this point in the history
Fixes #7374

The introduction of the AzureRM SDK 3.0.0-beta means that the
`name_servers` for the DNS Zone are returned from the API

This PR has a dependency on #7420 being merged first

```
make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMDnsZone_'
==> Checking that code complies with gofmt requirements...
/Users/stacko/Code/go/bin/stringer
go generate $(go list ./... | grep -v /vendor/)
2016/06/30 15:20:01 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMDnsZone_ -timeout 120m
=== RUN   TestAccAzureRMDnsZone_basic
--- PASS: TestAccAzureRMDnsZone_basic (92.42s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
92.444s
```
  • Loading branch information
stack72 committed Jun 30, 2016
1 parent 079e1f9 commit b8be98a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 17 deletions.
15 changes: 15 additions & 0 deletions builtin/providers/azurerm/resource_arm_dns_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ func resourceArmDnsZone() *schema.Resource {
Optional: true,
Computed: true,
},

"name_servers": &schema.Schema{
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
},
},
}
}
Expand Down Expand Up @@ -104,6 +111,14 @@ func resourceArmDnsZoneRead(d *schema.ResourceData, meta interface{}) error {
d.Set("number_of_record_sets", resp.NumberOfRecordSets)
d.Set("max_number_of_record_sets", resp.MaxNumberOfRecordSets)

nameServers := make([]string, 0, len(resp.NameServers))
for _, ns := range resp.NameServers {
nameServers = append(nameServers, *ns)
}
if err := d.Set("name_servers", nameServers); err != nil {
return err
}

return nil
}

Expand Down
12 changes: 6 additions & 6 deletions vendor/github.com/jen20/riviera/dns/get_dns_cname_recordset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/jen20/riviera/dns/get_dns_zone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -951,32 +951,32 @@
{
"checksumSHA1": "oPpOfZn11Ef6DWOoETxSW9Venzs=",
"path": "github.com/jen20/riviera/azure",
"revision": "2f01b8f5b09bbc20a591b1dc4b48af0665106b3f",
"revisionTime": "2016-06-10T12:18:12Z"
"revision": "1159d86fc8144abafeb29ee7c5a3e2e85af336ba",
"revisionTime": "2016-06-30T14:11:29Z"
},
{
"checksumSHA1": "A2Ycn6MySifUKTHOnsG9oLwjitE=",
"checksumSHA1": "ncdT+1PFEF5ly0niXuQc9/pKzT0=",
"path": "github.com/jen20/riviera/dns",
"revision": "2f01b8f5b09bbc20a591b1dc4b48af0665106b3f",
"revisionTime": "2016-06-10T12:18:12Z"
"revision": "1159d86fc8144abafeb29ee7c5a3e2e85af336ba",
"revisionTime": "2016-06-30T14:11:29Z"
},
{
"checksumSHA1": "zVXx6ha3bt0N4ukRbRHXjSl91S4=",
"path": "github.com/jen20/riviera/search",
"revision": "2f01b8f5b09bbc20a591b1dc4b48af0665106b3f",
"revisionTime": "2016-06-10T12:18:12Z"
"revision": "1159d86fc8144abafeb29ee7c5a3e2e85af336ba",
"revisionTime": "2016-06-30T14:11:29Z"
},
{
"checksumSHA1": "KfquDaeBPGchw92QnojlJFsJKgk=",
"path": "github.com/jen20/riviera/sql",
"revision": "2f01b8f5b09bbc20a591b1dc4b48af0665106b3f",
"revisionTime": "2016-06-10T12:18:12Z"
"revision": "1159d86fc8144abafeb29ee7c5a3e2e85af336ba",
"revisionTime": "2016-06-30T14:11:29Z"
},
{
"checksumSHA1": "nKUCquNpJ9ifHgkXoT4K3Xar6R8=",
"path": "github.com/jen20/riviera/storage",
"revision": "64de55fa8cdd0c52f7d59494c1b03c1b583c52b4",
"revisionTime": "2016-02-18T23:50:40Z"
"revision": "1159d86fc8144abafeb29ee7c5a3e2e85af336ba",
"revisionTime": "2016-06-30T14:11:29Z"
},
{
"comment": "0.2.2-2-gc01cf91",
Expand Down

0 comments on commit b8be98a

Please sign in to comment.