New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InSpec CLI exec "--controls=foo" option is not working as expected #5215
Comments
Thanks for the report, and the excellent description of the problem. Unfortunately, this reflects a deep-seated problem in inspec. InSpec evaluates all controls in order to access the metadata. Currently it does a full eval of the controls (but as I understand it, not the actual describe blocks), then marks them for filtering after the fact. |
Hello @klose4711 - Clinton hit the nail on the head there. Currently the code behaves as such:
The way to get the performance wins today is to leave as little time-sucking ruby code outside of the describe blocks as possible. For example, you will really be hurt using
In the longer term, this is a priority issue we are looking into as a team. I can't promise the fix tomorrow, but it is an issue product teams and engineering are aligned on resolving. |
Thanks @clintoncwolfe and @Schwad for the confirmation. 🙂 Looking forward to a fix. |
…ing the control block of not included controls in the controls option as it was filtering the controls from the list after evaluating updated the logic so that it gets evaluated after filtering. Removed filter_controls methods as no more using that Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
…ing the control block of not included controls in the controls option as it was filtering the controls from the list after evaluating updated the logic so that it gets evaluated after filtering. Removed filter_controls methods as no more using that Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Using the exec subcommand with option
--controls=foo
should only run thefoo
control, but it seems like it's still running all controls within the profile in background and only filtering the results output.Describe the problem
Have an InSpec profile with 3 controls: foo, bar, baz.
--controls
option will run all three controls and will take e.g. 03:00 min.--controls=foo
option should only run the one control, but it still takes 03:00 min. (Output is fine and only showing results for foo)So it seems like that all controls in the profile folder affect the execution time, although only those selected with the option should be executed.
According to the option description only the selected controls should be run:
The text was updated successfully, but these errors were encountered: