From cf966d0cbb06f9f19c7a1628f900c96c230c7fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Grumb=C3=B6ck?= Date: Sat, 3 Oct 2020 22:19:04 +0200 Subject: [PATCH] Smarter way to skip zone not matching view --- provider/infoblox/infoblox.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/provider/infoblox/infoblox.go b/provider/infoblox/infoblox.go index ae564519e..fbf74853d 100644 --- a/provider/infoblox/infoblox.go +++ b/provider/infoblox/infoblox.go @@ -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) }