Commit 72880fb4 authored by BSRK Aditya's avatar BSRK Aditya Committed by Klaus Aehlig

Call the filter again with runtime data this time

genericQuery filters objects without runtime data first.
We need to filter the objects again, this time with runtime data.

This fixes issue 1100.
Signed-off-by: default avatarBSRK Aditya <bsrk@google.com>
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 2ea97cf5
......@@ -227,13 +227,15 @@ genericQuery fieldsMap collector nameFn configFn getFn cfg
_ -> mapM (getFn cfg) wanted
-- Run the first pass of the filter, without a runtime context; this will
-- limit the objects that we'll contact for exports
fobjects <- toError $ filterM (\n -> evaluateFilter cfg Nothing n cfilter)
objects
-- Gather the runtime data
runtimes <- case collector of
fobjects <- toError $
filterM (\n -> evaluateQueryFilter cfg Nothing n cfilter) objects
-- Gather the runtime data and filter the results again,
-- based on the gathered data
runtimes <- (case collector of
CollectorSimple collFn -> lift $ collFn live' cfg fobjects
CollectorFieldAware collFn -> lift $ collFn live' cfg fields fobjects
-- Filter the results again, based on the gathered data
CollectorFieldAware collFn -> lift $ collFn live' cfg fields fobjects) >>=
(toError . filterM (\(obj, runtime) ->
evaluateQueryFilter cfg (Just runtime) obj cfilter))
let fdata = map (\(obj, runtime) ->
map (execGetter cfg runtime obj) fgetters)
runtimes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment