Updated the godo SDK to version v1.4.2 in order to enable setting a dns' record weight to 0

This commit is contained in:
Tilen Faganel 2018-08-31 01:45:30 +01:00
parent ad2043e60f
commit 5ae9788413
No known key found for this signature in database
GPG Key ID: 3DDA5ABF228F8E7A
6 changed files with 64 additions and 8 deletions

View File

@ -260,6 +260,39 @@ func TestAccDigitalOceanRecord_MX_at(t *testing.T) {
})
}
func TestAccDigitalOceanRecord_SRV_zero_weight(t *testing.T) {
var record godo.DomainRecord
domain := fmt.Sprintf("foobar-test-terraform-%s.com", acctest.RandString(10))
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckDigitalOceanRecordDestroy,
Steps: []resource.TestStep{
{
Config: fmt.Sprintf(
testAccCheckDigitalOceanRecordConfig_srv_zero_weight, domain),
Check: resource.ComposeTestCheckFunc(
testAccCheckDigitalOceanRecordExists("digitalocean_record.foo_record", &record),
testAccCheckDigitalOceanRecordAttributesHostname("foobar."+domain, &record),
resource.TestCheckResourceAttr(
"digitalocean_record.foo_record", "name", "_service._protocol"),
resource.TestCheckResourceAttr(
"digitalocean_record.foo_record", "domain", domain),
resource.TestCheckResourceAttr(
"digitalocean_record.foo_record", "value", "foobar."+domain+"."),
resource.TestCheckResourceAttr(
"digitalocean_record.foo_record", "type", "SRV"),
resource.TestCheckResourceAttr(
"digitalocean_record.foo_record", "port", "443"),
resource.TestCheckResourceAttr(
"digitalocean_record.foo_record", "weight", "0"),
),
},
},
})
}
func TestAccDigitalOceanRecord_UpdateBasic(t *testing.T) {
var record godo.DomainRecord
domain := fmt.Sprintf("foobar-test-terraform-%s.com", acctest.RandString(10))
@ -659,6 +692,23 @@ resource "digitalocean_record" "foobar" {
tag = "issue"
}`
const testAccCheckDigitalOceanRecordConfig_srv_zero_weight = `
resource "digitalocean_domain" "foobar" {
name = "%s"
ip_address = "192.168.0.10"
}
resource "digitalocean_record" "foo_record" {
domain = "${digitalocean_domain.foobar.name}"
name = "_service._protocol"
value = "foobar.${digitalocean_domain.foobar.name}."
type = "SRV"
priority = "10"
port = "443"
weight = "0"
}`
const testAccCheckDigitalOceanRecordConfig_updated_basic = `
resource "digitalocean_domain" "foobar" {
name = "%s"

View File

@ -1,5 +1,10 @@
# Change Log
## [v1.4.2] - 2018-08-30
- #178 Allowing creating domain records with weight of 0 - @TFaga
- #177 Adding `VolumeLimit` to account - @lxfontes
## [v1.4.1] - 2018-08-23
- #176 Fix cdn flush cache API endpoint - @sunny-b

View File

@ -24,6 +24,7 @@ var _ AccountService = &AccountServiceOp{}
type Account struct {
DropletLimit int `json:"droplet_limit,omitempty"`
FloatingIPLimit int `json:"floating_ip_limit,omitempty"`
VolumeLimit int `json:"volume_limit,omitempty"`
Email string `json:"email,omitempty"`
UUID string `json:"uuid,omitempty"`
EmailVerified bool `json:"email_verified,omitempty"`

View File

@ -75,7 +75,7 @@ type DomainRecord struct {
Priority int `json:"priority"`
Port int `json:"port,omitempty"`
TTL int `json:"ttl,omitempty"`
Weight int `json:"weight,omitempty"`
Weight int `json:"weight"`
Flags int `json:"flags"`
Tag string `json:"tag,omitempty"`
}
@ -88,7 +88,7 @@ type DomainRecordEditRequest struct {
Priority int `json:"priority"`
Port int `json:"port,omitempty"`
TTL int `json:"ttl,omitempty"`
Weight int `json:"weight,omitempty"`
Weight int `json:"weight"`
Flags int `json:"flags"`
Tag string `json:"tag,omitempty"`
}

View File

@ -18,7 +18,7 @@ import (
)
const (
libraryVersion = "1.4.1"
libraryVersion = "1.4.2"
defaultBaseURL = "https://api.digitalocean.com/"
userAgent = "godo/" + libraryVersion
mediaType = "application/json"

10
vendor/vendor.json vendored
View File

@ -251,13 +251,13 @@
"revisionTime": "2016-10-29T20:57:26Z"
},
{
"checksumSHA1": "YkfXtYXa+nInWIOfBeHVCXWvXQs=",
"checksumSHA1": "aiCBBVRj3GySoe6VRkpitpVQYdU=",
"comment": "v0.9.0-20-gf75d769",
"path": "github.com/digitalocean/godo",
"revision": "ddc940d8ef8b736b5cdfc47f24cdf95b9a4b73f6",
"revisionTime": "2018-08-23T18:38:25Z",
"version": "v1.4.1",
"versionExact": "v1.4.1"
"revision": "6a6ce62154ba780ecbb97bbbb13a4e9e0b157070",
"revisionTime": "2018-08-30T17:48:58Z",
"version": "v1.4.2",
"versionExact": "v1.4.2"
},
{
"checksumSHA1": "HbOJxa+FsQ1TTsF+BkHAvzqqZv4=",