Skip to content
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

Merged
merged 2 commits into from
Sep 9, 2020

Conversation

thheinen
Copy link
Contributor

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

Signed-off-by: Thomas Heinen <theinen@tecracer.de>
@@ -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]
Copy link
Contributor

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.

Copy link
Contributor Author

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>
Copy link
Contributor

@clintoncwolfe clintoncwolfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@clintoncwolfe clintoncwolfe added Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number. Type: Enhancement Adds new functionality. labels Sep 8, 2020
@Schwad Schwad merged commit b406ef2 into inspec:master Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number. Type: Enhancement Adds new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants