mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
VULTR: use API v2 (#1768)
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/StackExchange/dnscontrol/v3/models"
|
||||
"github.com/vultr/govultr"
|
||||
"github.com/vultr/govultr/v2"
|
||||
)
|
||||
|
||||
func TestConversion(t *testing.T) {
|
||||
@@ -12,7 +12,7 @@ func TestConversion(t *testing.T) {
|
||||
Name: "example.com",
|
||||
}
|
||||
|
||||
records := []*govultr.DNSRecord{
|
||||
records := []*govultr.DomainRecord{
|
||||
{
|
||||
Type: "A",
|
||||
Name: "",
|
||||
@@ -29,14 +29,14 @@ func TestConversion(t *testing.T) {
|
||||
Type: "SRV",
|
||||
Name: "_ssh_.tcp",
|
||||
Data: "5 22 ssh.example.com",
|
||||
Priority: intPtr(5),
|
||||
Priority: 5,
|
||||
TTL: 300,
|
||||
},
|
||||
{
|
||||
Type: "MX",
|
||||
Name: "",
|
||||
Data: "mail.example.com",
|
||||
Priority: intPtr(0),
|
||||
Priority: 0,
|
||||
TTL: 300,
|
||||
},
|
||||
{
|
||||
@@ -65,9 +65,9 @@ func TestConversion(t *testing.T) {
|
||||
t.Error("Error converting Vultr record", record)
|
||||
}
|
||||
|
||||
converted := toVultrRecord(dc, rc, 0)
|
||||
converted := toVultrRecord(dc, rc, "0")
|
||||
|
||||
if converted.Type != record.Type || converted.Name != record.Name || converted.Data != record.Data || ((converted.Priority == nil) != (record.Priority == nil) || (converted.Priority != nil && *converted.Priority != *record.Priority)) || converted.TTL != record.TTL {
|
||||
if converted.Type != record.Type || converted.Name != record.Name || converted.Data != record.Data || (converted.Priority != record.Priority) || converted.TTL != record.TTL {
|
||||
t.Error("Vultr record conversion mismatch", record, rc, converted)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user