Smarter way to skip zone not matching view

This commit is contained in:
Johannes Grumböck 2020-10-03 22:19:04 +02:00
parent b9d8a4ac63
commit cf966d0cbb

View File

@ -232,7 +232,11 @@ func (p *InfobloxProvider) ApplyChanges(ctx context.Context, changes *plan.Chang
func (p *InfobloxProvider) zones() ([]ibclient.ZoneAuth, error) {
var res, result []ibclient.ZoneAuth
obj := ibclient.NewZoneAuth(ibclient.ZoneAuth{})
obj := ibclient.NewZoneAuth(
ibclient.ZoneAuth{
View: p.view,
},
)
err := p.client.GetObject(obj, "", &res)
if err != nil {
@ -248,11 +252,6 @@ func (p *InfobloxProvider) zones() ([]ibclient.ZoneAuth, error) {
continue
}
// Skip zones not matching the view
if p.view != "" && zone.View != p.view {
continue
}
result = append(result, zone)
}