Skip to content

Commit b0e7170

Browse files
authored
Fix answer groups not wiped out (#333)
1 parent 6f40ebf commit b0e7170

File tree

5 files changed

+53
-4
lines changed

5 files changed

+53
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.4.5 (October 17, 2024)
2+
BUGFIX
3+
* `ns1-go` client version bump to allow wiping out record regions
4+
15
## 2.4.4 (October 10, 2024)
26
BUGFIX
37
* Adds support for setting override_address_records for ALIAS records

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/hashicorp/go-retryablehttp v0.7.7
88
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1
99
github.com/stretchr/testify v1.8.1
10-
gopkg.in/ns1/ns1-go.v2 v2.12.0
10+
gopkg.in/ns1/ns1-go.v2 v2.12.2
1111
)
1212

1313
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8
251251
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
252252
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
253253
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
254-
gopkg.in/ns1/ns1-go.v2 v2.12.0 h1:cqdqQoTx17JmTusfxh5m3e2b36jfUzFAZedv89pFX18=
255-
gopkg.in/ns1/ns1-go.v2 v2.12.0/go.mod h1:pfaU0vECVP7DIOr453z03HXS6dFJpXdNRwOyRzwmPSc=
254+
gopkg.in/ns1/ns1-go.v2 v2.12.2 h1:SPM5BTTMJ1zVBhMMiiPFdF7l6Y3fq5o7bKM7jDqsUfM=
255+
gopkg.in/ns1/ns1-go.v2 v2.12.2/go.mod h1:pfaU0vECVP7DIOr453z03HXS6dFJpXdNRwOyRzwmPSc=
256256
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
257257
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
258258
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

ns1/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
)
2020

2121
var (
22-
clientVersion = "2.4.4"
22+
clientVersion = "2.4.5"
2323
providerUserAgent = "tf-ns1" + "/" + clientVersion
2424
defaultRetryMax = 3
2525
)

ns1/resource_record_test.go

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,19 @@ func TestAccRecord_updatedWithRegions(t *testing.T) {
565565
),
566566
),
567567
},
568+
{
569+
Config: testAccRecordUpdatedWithNoRegions(rString),
570+
Check: resource.ComposeTestCheckFunc(
571+
testAccCheckRecordExists("ns1_record.it", &record),
572+
testAccCheckRecordDomain(&record, domainName),
573+
testAccCheckRecordTTL(&record, 60),
574+
testAccCheckRecordUseClientSubnet(&record, true),
575+
testAccCheckRecordRegionName(&record, []string{}),
576+
testAccCheckRecordAnswerRdata(
577+
t, &record, 0, []string{fmt.Sprintf("test1.%s", zoneName)},
578+
),
579+
),
580+
},
568581
{
569582
ResourceName: "ns1_record.it",
570583
ImportState: true,
@@ -1961,6 +1974,38 @@ resource "ns1_zone" "test" {
19611974
`, rString)
19621975
}
19631976

1977+
func testAccRecordUpdatedWithNoRegions(rString string) string {
1978+
return fmt.Sprintf(`
1979+
resource "ns1_record" "it" {
1980+
zone = "${ns1_zone.test.zone}"
1981+
domain = "test.${ns1_zone.test.zone}"
1982+
type = "CNAME"
1983+
ttl = 60
1984+
1985+
answers {
1986+
answer = "test1.${ns1_zone.test.zone}"
1987+
}
1988+
1989+
filters {
1990+
filter = "geotarget_country"
1991+
}
1992+
1993+
filters {
1994+
filter = "select_first_n"
1995+
config = {N=1}
1996+
}
1997+
1998+
filters {
1999+
filter = "up"
2000+
}
2001+
}
2002+
2003+
resource "ns1_zone" "test" {
2004+
zone = "terraform-test-%s.io"
2005+
}
2006+
`, rString)
2007+
}
2008+
19642009
// zone and domain have leading and trailing dots and should fail validation.
19652010
func testAccRecordInvalid(rString string) string {
19662011
return fmt.Sprintf(`

0 commit comments

Comments
 (0)