We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 272851c + 212ba07 commit c1c0982Copy full SHA for c1c0982
client.go
@@ -135,7 +135,7 @@ func (p *Provider) deleteRecord(ctx context.Context, id uint64, zone string) err
135
return err
136
}
137
138
-func (p *Provider) findRecord(ctx context.Context, zone string, record libdns.Record) (uint64, error) {
+func (p *Provider) findRecord(ctx context.Context, zone string, record libdns.Record, matchValue bool) (uint64, error) {
139
domain := strings.TrimSuffix(zone, ".")
140
r := fromLibdnsRecord(record)
141
requestData := FindRecordRequest{
@@ -162,7 +162,7 @@ func (p *Provider) findRecord(ctx context.Context, zone string, record libdns.Re
162
var recordId uint64
163
for _, item := range response.Response.RecordList {
164
if item.Name == r.Name && item.Type == r.Type {
165
- if r.Value != "" && item.Value != r.Value {
+ if matchValue && r.Value != "" && item.Value != r.Value {
166
continue
167
168
recordId = uint64(item.RecordId)
provider.go
@@ -23,7 +23,7 @@ func (p *Provider) AppendRecords(ctx context.Context, zone string, records []lib
23
24
func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error) {
25
for _, record := range records {
26
- id, err := p.findRecord(ctx, zone, record)
+ id, err := p.findRecord(ctx, zone, record, false)
27
if err != nil {
28
if errors.Is(err, ErrRecordNotFound) {
29
if err = p.createRecord(ctx, zone, record); err != nil {
@@ -42,7 +42,7 @@ func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns
42
43
func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error) {
44
45
+ id, err := p.findRecord(ctx, zone, record, true)
46
47
return nil, err
48
0 commit comments