Merge pull request #2857 from Volatus/master

bug: fix digital ocean provider not setting TTL
This commit is contained in:
Kubernetes Prow Robot 2022-12-24 08:57:26 -08:00 committed by GitHub
commit a68da28241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -172,7 +172,8 @@ func (p *DigitalOceanProvider) Records(ctx context.Context) ([]*endpoint.Endpoin
name = zone.Name
}
ep := endpoint.NewEndpoint(name, r.Type, r.Data)
ep := endpoint.NewEndpointWithTTL(name, r.Type, endpoint.TTL(r.TTL), r.Data)
endpoints = append(endpoints, ep)
}
}

View File

@ -333,6 +333,17 @@ func TestDigitalOceanMakeDomainEditRequest(t *testing.T) {
Data: "bar.example.com.",
TTL: digitalOceanRecordTTL,
}, r3)
// Ensure that custom TTLs can be set
customTTL := 600
r4 := makeDomainEditRequest("example.com", "foo.example.com", endpoint.RecordTypeCNAME,
"bar.example.com.", customTTL)
assert.Equal(t, &godo.DomainRecordEditRequest{
Type: endpoint.RecordTypeCNAME,
Name: "foo",
Data: "bar.example.com.",
TTL: customTTL,
}, r4)
}
func TestDigitalOceanApplyChanges(t *testing.T) {