kitchen-vagrant icon indicating copy to clipboard operation
kitchen-vagrant copied to clipboard

Allow the ability to explicitly enable caching

Open jakauppila opened this issue 7 years ago • 9 comments

With https://github.com/test-kitchen/kitchen-vagrant/pull/303 cache is only available when using utilizing known bento boxes through a whitelist even though I'm explicitly specifying cachier: true. This took a while of digging as it was previously working on some Windows boxes.

What is the correct course of action to allow the ability to utilize the cache when not using bento boxes? I'd be happy to slap in another config option if that's what's needed.

jakauppila avatar Mar 07 '18 00:03 jakauppila

cachier is super specifically vagrant-cachier which is an entirely specific thing. That PR specifically has to do with disabling these things by default unless we know it's a bento box

Otherwise, just reference https://github.com/test-kitchen/kitchen-vagrant#-cache_directory and set cache_directory to get the chef-client caching. Mind you this only works if the instance supports shared folders through your provider, otherwise you're still hosed.

cheeseplus avatar Mar 07 '18 02:03 cheeseplus

If I'm reading this right, even if I specify cache_directory it's not going to work since I'm not using a bento box.

https://github.com/test-kitchen/kitchen-vagrant/blob/master/lib/kitchen/driver/vagrant.rb#L252

jakauppila avatar Mar 07 '18 03:03 jakauppila

That is correct, the feature is only supported on specific boxes we know it works on.

coderanger avatar Mar 07 '18 19:03 coderanger

Sure, but for cases where I know the feature works for a non-bento box, shouldn't there be a config option that I can explicitly allow it? Definitely understand if it's disabled by default.

jakauppila avatar Mar 07 '18 19:03 jakauppila

Mostly we didn't want to deal with the support burden because the caching system was more than a bit unstable at first. I think it had settled down enough that we would be open to a patch to allow it, though I'm not sure of the best approach.

coderanger avatar Mar 07 '18 20:03 coderanger

Happy to look at a patch, to be honest I thought we'd left it so that a user could explicitly set the dir still so I'm happy to fix this one. I was mostly cleaning up other folks code which was a bit more liberal about enabling as @coderanger mentions so this was probably erring on the side of safety at the time without realizing it.

cheeseplus avatar Mar 26 '18 11:03 cheeseplus

Do you have a preference for how it's implemented?

  • Just allowing the existence of cache_directory to enable it
  • Explicit configuration option to enable
  • 'Safe' box name override configuration option

jakauppila avatar Mar 27 '18 00:03 jakauppila

In my mind we should honor cache_directory if explicitly set and only automatically enable it when it's one of the blessed sub-set of bento boxes.

cheeseplus avatar Apr 05 '18 14:04 cheeseplus

Any chance we could resurrect #357 or at a minimum add the @tas50 Windows boxes to the safe_share? list?

jakauppila avatar May 29 '20 21:05 jakauppila