Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the right query params on infoblox #3301

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions provider/infoblox/infoblox.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,24 @@ func (p *ProviderConfig) Records(ctx context.Context) (endpoints []*endpoint.End

for _, zone := range zones {
logrus.Debugf("fetch records from zone '%s'", zone.Fqdn)

view := p.view
if view == "" {
view = "default"
}
searchParams := ibclient.NewQueryParams(
false,
map[string]string{
"zone": zone.Fqdn,
"view": view,
},
)

var resA []ibclient.RecordA
objA := ibclient.NewEmptyRecordA()
objA.View = p.view
objA.Zone = zone.Fqdn
err = p.client.GetObject(objA, "", nil, &resA)
err = p.client.GetObject(objA, "", searchParams, &resA)
if err != nil && !isNotFoundError(err) {
return nil, fmt.Errorf("could not fetch A records from zone '%s': %s", zone.Fqdn, err)
}
Expand Down Expand Up @@ -242,7 +255,7 @@ func (p *ProviderConfig) Records(ctx context.Context) (endpoints []*endpoint.End
objH := ibclient.NewEmptyHostRecord()
objH.View = p.view
objH.Zone = zone.Fqdn
err = p.client.GetObject(objH, "", nil, &resH)
err = p.client.GetObject(objH, "", searchParams, &resH)
if err != nil && !isNotFoundError(err) {
return nil, fmt.Errorf("could not fetch host records from zone '%s': %s", zone.Fqdn, err)
}
Expand All @@ -264,7 +277,7 @@ func (p *ProviderConfig) Records(ctx context.Context) (endpoints []*endpoint.End
objC := ibclient.NewEmptyRecordCNAME()
objC.View = p.view
objC.Zone = zone.Fqdn
err = p.client.GetObject(objC, "", nil, &resC)
err = p.client.GetObject(objC, "", searchParams, &resC)
if err != nil && !isNotFoundError(err) {
return nil, fmt.Errorf("could not fetch CNAME records from zone '%s': %s", zone.Fqdn, err)
}
Expand All @@ -283,7 +296,7 @@ func (p *ProviderConfig) Records(ctx context.Context) (endpoints []*endpoint.End
objP := ibclient.NewEmptyRecordPTR()
objP.Zone = arpaZone
objP.View = p.view
err = p.client.GetObject(objP, "", nil, &resP)
err = p.client.GetObject(objP, "", searchParams, &resP)
if err != nil && !isNotFoundError(err) {
return nil, fmt.Errorf("could not fetch PTR records from zone '%s': %s", zone.Fqdn, err)
}
Expand All @@ -300,7 +313,7 @@ func (p *ProviderConfig) Records(ctx context.Context) (endpoints []*endpoint.End
View: p.view,
},
)
err = p.client.GetObject(objT, "", nil, &resT)
err = p.client.GetObject(objT, "", searchParams, &resT)
if err != nil && !isNotFoundError(err) {
return nil, fmt.Errorf("could not fetch TXT records from zone '%s': %s", zone.Fqdn, err)
}
Expand Down