diff --git a/plan/plan.go b/plan/plan.go index d0ca7f96a2..a110e8b118 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -245,10 +245,6 @@ func (p *Plan) Calculate() *Plan { } } - for _, pol := range p.Policies { - changes = pol.Apply(changes) - } - // filter out updates this external dns does not have ownership claim over if p.OwnerID != "" { changes.Delete = endpoint.FilterEndpointsByOwnerID(p.OwnerID, changes.Delete) @@ -257,6 +253,10 @@ func (p *Plan) Calculate() *Plan { changes.UpdateNew = endpoint.FilterEndpointsByOwnerID(p.OwnerID, changes.UpdateNew) } + for _, pol := range p.Policies { + changes = pol.Apply(changes) + } + plan := &Plan{ Current: p.Current, Desired: p.Desired,