Merge pull request #3859 from justinsb/upsert_dns_records

Automatic merge from submit-queue.

Use upsert when applying DNS records
This commit is contained in:
Kubernetes Submit Queue 2017-11-15 08:39:38 -08:00 committed by GitHub
commit 2b2b5971b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -567,14 +567,9 @@ func (o *dnsOp) updateRecords(k recordKey, newRecords []string, ttl int64) error
return err
}
if existing != nil {
glog.V(2).Infof("will replace existing dns record %s %s", existing.Type(), FixWildcards(existing.Name()))
cs.Remove(existing)
}
glog.V(2).Infof("Adding DNS changes to batch %s %s", k, newRecords)
rr := rrsProvider.New(fqdn, newRecords, ttl, rrstype.RrsType(k.RecordType))
cs.Add(rr)
cs.Upsert(rr)
return nil
}