-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add ability to disable input caching in InSpec #258
Conversation
Signed-off-by: Thomas Heinen <theinen@tecracer.de>
lib/kitchen/verifier/inspec.rb
Outdated
@@ -88,6 +88,8 @@ def call(state) | |||
v2_loader = ::Inspec::Plugin::V2::Loader.new | |||
v2_loader.load_all | |||
v2_loader.exit_on_load_error | |||
|
|||
::Inspec::InputRegistry.instance.cache_inputs = !!config[:cache_inputs] if config[:cache_inputs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned about tightly coupling the versions of kitchen-inspec and the inspec-core gem. Right now the only constraint in the gemspec is to make sure inspec has plugin support, so it is a broad range of versions that can be compatible. If we tighten the constraint to be the latest release - presumably a release after inspec/inspec#5211 merges - then people can only use kitchen-inspec with the very latest InSpec.
Could we put a guard clause around this that detects if Inspec::InputRegistry.instance responds to cache_inputs=
? That would make it more loosely coupled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pushed with a guard, is that what you had in mind?
Signed-off-by: Thomas Heinen <theinen@tecracer.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
This allows deactivating the input caching in InSpec to avoid values from previous suites to persist into follow-up runs.
For a detailed explanation see InSpec PR #5211.
Issues Resolved
See InSpec PR #5211.
Check List