Skip to content

Commit 3db5a79

Browse files
authored
fix TTL not being updated (#38)
1 parent 18216cd commit 3db5a79

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

internal/designate/provider/provider.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ func addEndpoint(ep *endpoint.Endpoint, recordSets map[string]*recordSet, oldEnd
179179
dnsName: canonicalizeDomainName(ep.DNSName),
180180
recordType: ep.RecordType,
181181
names: make(map[string]bool),
182-
ttl: int(ep.RecordTTL),
183182
}
184183
}
185184

@@ -191,6 +190,7 @@ func addEndpoint(ep *endpoint.Endpoint, recordSets map[string]*recordSet, oldEnd
191190
if rs.recordSetID == "" {
192191
rs.recordSetID = ep.Labels[designateRecordSetID]
193192
}
193+
rs.ttl = int(ep.RecordTTL)
194194
for _, rec := range strings.Split(ep.Labels[designateOriginalRecords], "\000") {
195195
if _, ok := rs.names[rec]; !ok && rec != "" {
196196
rs.names[rec] = true

internal/designate/provider/provider_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ func testDesignateUpdateRecords(t *testing.T, client *fakeDesignateClient) []*re
522522
copy(expectedCopy, expected)
523523

524524
expected[2].Records = []string{"10.3.3.1"}
525+
expected[2].TTL = 60
525526
expected[3].Records = []string{"10.2.1.1", "10.3.3.2"}
526527

527528
err := client.ToProvider().ApplyChanges(context.Background(), &plan.Changes{UpdateOld: updatesOld, UpdateNew: updatesNew})

0 commit comments

Comments
 (0)