mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-07 01:56:57 +02:00
Merge pull request #3301 from rikatz/fix-externaldns-infoblox-queries
Add the right query params on infoblox
This commit is contained in:
commit
510eb952b7
@ -192,11 +192,24 @@ func (p *ProviderConfig) Records(ctx context.Context) (endpoints []*endpoint.End
|
|||||||
|
|
||||||
for _, zone := range zones {
|
for _, zone := range zones {
|
||||||
logrus.Debugf("fetch records from zone '%s'", zone.Fqdn)
|
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
|
var resA []ibclient.RecordA
|
||||||
objA := ibclient.NewEmptyRecordA()
|
objA := ibclient.NewEmptyRecordA()
|
||||||
objA.View = p.view
|
objA.View = p.view
|
||||||
objA.Zone = zone.Fqdn
|
objA.Zone = zone.Fqdn
|
||||||
err = p.client.GetObject(objA, "", nil, &resA)
|
err = p.client.GetObject(objA, "", searchParams, &resA)
|
||||||
if err != nil && !isNotFoundError(err) {
|
if err != nil && !isNotFoundError(err) {
|
||||||
return nil, fmt.Errorf("could not fetch A records from zone '%s': %s", zone.Fqdn, err)
|
return nil, fmt.Errorf("could not fetch A records from zone '%s': %s", zone.Fqdn, err)
|
||||||
}
|
}
|
||||||
@ -242,7 +255,7 @@ func (p *ProviderConfig) Records(ctx context.Context) (endpoints []*endpoint.End
|
|||||||
objH := ibclient.NewEmptyHostRecord()
|
objH := ibclient.NewEmptyHostRecord()
|
||||||
objH.View = p.view
|
objH.View = p.view
|
||||||
objH.Zone = zone.Fqdn
|
objH.Zone = zone.Fqdn
|
||||||
err = p.client.GetObject(objH, "", nil, &resH)
|
err = p.client.GetObject(objH, "", searchParams, &resH)
|
||||||
if err != nil && !isNotFoundError(err) {
|
if err != nil && !isNotFoundError(err) {
|
||||||
return nil, fmt.Errorf("could not fetch host records from zone '%s': %s", zone.Fqdn, err)
|
return nil, fmt.Errorf("could not fetch host records from zone '%s': %s", zone.Fqdn, err)
|
||||||
}
|
}
|
||||||
@ -264,7 +277,7 @@ func (p *ProviderConfig) Records(ctx context.Context) (endpoints []*endpoint.End
|
|||||||
objC := ibclient.NewEmptyRecordCNAME()
|
objC := ibclient.NewEmptyRecordCNAME()
|
||||||
objC.View = p.view
|
objC.View = p.view
|
||||||
objC.Zone = zone.Fqdn
|
objC.Zone = zone.Fqdn
|
||||||
err = p.client.GetObject(objC, "", nil, &resC)
|
err = p.client.GetObject(objC, "", searchParams, &resC)
|
||||||
if err != nil && !isNotFoundError(err) {
|
if err != nil && !isNotFoundError(err) {
|
||||||
return nil, fmt.Errorf("could not fetch CNAME records from zone '%s': %s", zone.Fqdn, err)
|
return nil, fmt.Errorf("could not fetch CNAME records from zone '%s': %s", zone.Fqdn, err)
|
||||||
}
|
}
|
||||||
@ -283,7 +296,7 @@ func (p *ProviderConfig) Records(ctx context.Context) (endpoints []*endpoint.End
|
|||||||
objP := ibclient.NewEmptyRecordPTR()
|
objP := ibclient.NewEmptyRecordPTR()
|
||||||
objP.Zone = arpaZone
|
objP.Zone = arpaZone
|
||||||
objP.View = p.view
|
objP.View = p.view
|
||||||
err = p.client.GetObject(objP, "", nil, &resP)
|
err = p.client.GetObject(objP, "", searchParams, &resP)
|
||||||
if err != nil && !isNotFoundError(err) {
|
if err != nil && !isNotFoundError(err) {
|
||||||
return nil, fmt.Errorf("could not fetch PTR records from zone '%s': %s", zone.Fqdn, err)
|
return nil, fmt.Errorf("could not fetch PTR records from zone '%s': %s", zone.Fqdn, err)
|
||||||
}
|
}
|
||||||
@ -300,7 +313,7 @@ func (p *ProviderConfig) Records(ctx context.Context) (endpoints []*endpoint.End
|
|||||||
View: p.view,
|
View: p.view,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
err = p.client.GetObject(objT, "", nil, &resT)
|
err = p.client.GetObject(objT, "", searchParams, &resT)
|
||||||
if err != nil && !isNotFoundError(err) {
|
if err != nil && !isNotFoundError(err) {
|
||||||
return nil, fmt.Errorf("could not fetch TXT records from zone '%s': %s", zone.Fqdn, err)
|
return nil, fmt.Errorf("could not fetch TXT records from zone '%s': %s", zone.Fqdn, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user