Skip to content

Commit

Permalink
Limit getting infoblox records to the specified zone
Browse files Browse the repository at this point in the history
  • Loading branch information
superseb authored and yasker committed Oct 31, 2017
1 parent 3ccfbc3 commit d192ed0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions providers/infoblox/infoblox.go
Expand Up @@ -142,7 +142,7 @@ func (d *InfobloxProvider) AddRecord(record utils.DnsRecord) (err error) {

func (d *InfobloxProvider) findRecords(record utils.DnsRecord) ([]*Record, error) {
var records []*Record
url := recordURL + ":" + strings.ToLower(record.Type) + "?name=" + utils.UnFqdn(record.Fqdn)
url := recordURL + ":" + strings.ToLower(record.Type) + "?name=" + utils.UnFqdn(record.Fqdn) + "&zone=" + d.zoneName
res, err := d.client.SendRequest("GET", url, "", head)
if err != nil {
return records, fmt.Errorf("Infoblox API call has failed: %v", err)
Expand Down Expand Up @@ -178,7 +178,7 @@ func (d *InfobloxProvider) RemoveRecord(record utils.DnsRecord) error {

func (d *InfobloxProvider) GetRecords() ([]utils.DnsRecord, error) {
var records []utils.DnsRecord
res, err := d.client.SendRequest("GET", recordAURL+"?"+recordAQuery, "", head)
res, err := d.client.SendRequest("GET", recordAURL+"?"+recordAQuery+"&zone="+d.zoneName, "", head)
if err != nil {
return records, fmt.Errorf("Infoblox API call has failed: %v", err)
}
Expand All @@ -187,7 +187,7 @@ func (d *InfobloxProvider) GetRecords() ([]utils.DnsRecord, error) {
return records, fmt.Errorf("Infoblox API call decode has failed: %v", err)
}

res2, err := d.client.SendRequest("GET", recordTxtURL+"?"+recordTxtQuery, "", head)
res2, err := d.client.SendRequest("GET", recordTxtURL+"?"+recordTxtQuery+"&zone="+d.zoneName, "", head)
if err != nil {
return records, fmt.Errorf("Infoblox API call has failed: %v", err)
}
Expand Down

0 comments on commit d192ed0

Please sign in to comment.