Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Cachier should not bail out #142

Closed
tknerr opened this issue Apr 23, 2015 · 3 comments
Closed

Cachier should not bail out #142

tknerr opened this issue Apr 23, 2015 · 3 comments
Labels

Comments

@tknerr
Copy link

tknerr commented Apr 23, 2015

Given a Vagrantfile like this:

Vagrant.configure(2) do |config|
  config.vm.provider "docker" do |d|
    d.build_dir = "."  # Dockerfile right here
  end
end

When I vagrant up, cachier bails out hard with an exception:

C:\Repos\_github\bills-kitchen\target\build\tmp\vagrocker>vagrant up
Bringing machine 'default' up with 'docker' provider...
==> default: Docker host is required. One will be created if necessary...
    default: Docker host VM is already ready.
C:/Repos/_github/bills-kitchen/target/build/home/.vagrant.d/gems/gems/vagrant-cachier-1.2.0/lib/vagrant-cachier/action/configure_bucket_root.rb:44: in `cache_root': Cachier plugin only supported with docker provider when image is used (RuntimeError)
        from C:/Repos/_github/bills-kitchen/target/build/home/.vagrant.d/gems/gems/vagrant-cachier-1.2.0/lib/vagrant-cachier/action/configure_bucket_root.rb:24: in `setup_buckets_folder'
        from C:/Repos/_github/bills-kitchen/target/build/home/.vagrant.d/gems/gems/vagrant-cachier-1.2.0/lib/vagrant-cachier/action/configure_bucket_root.rb:16: in `call'
        from C:/Repos/_github/bills-kitchen/target/build/tools/vagrant/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34: in `call'
        from C:/Repos/_github/bills-kitchen/target/build/tools/vagrant/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:95: in `block in finalize_action'
        from C:/Repos/_github/bills-kitchen/target/build/tools/vagrant/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34: in `call'

Well, it says clearly "Cachier plugin only supported with docker provider when image is used (RuntimeError)". Well, I didn't use image but build_dir instead.

So clearly it's my fault, but wouldn't it be possible to disable the bucket / cachier instead of throwing an exception here?

@tknerr
Copy link
Author

tknerr commented Apr 23, 2015

I have to add that I have vagrant-cachier globally (and transparently) enabled via my global ~/.vagrant.d/Vagrantfile:

Vagrant.configure("2") do |config|
  # enable cachier globally
  if Vagrant.has_plugin?("vagrant-cachier")
    config.cache.scope = :box
  end
end

That's why cachier is enabled in the first place.

I like that approach because it's totally transparent. However, as you see it bails out when I use build_dir in the example above.

@lferro9000
Copy link

Shouldn't the docker VM that uses build_dir be:

Vagrant.configure(2) do |config|
config.vm.provider "docker" do |d|
config.cache.enable = false
d.build_dir = "." # Dockerfile right here
end
end

There are references on https://github.com/fgrehm/vagrant-cachier/blob/master/lib/vagrant-cachier/config.rb regarding the a disable! and the enabled value.

Also, if ALLOWED scope had a NONE value, that could be checked and if scope was NONE, then that could be used to trigger a "soft" disable.

@fgrehm fgrehm added the ignored label Nov 22, 2022
@fgrehm
Copy link
Owner

fgrehm commented Nov 22, 2022

Hey, sorry for the silence here but this project is looking for maintainers 😅

As per #193, I've added the ignored label and will close this issue. Thanks for the interest in the project and LMK if you want to step up and take ownership of this project on that other issue 👋

@fgrehm fgrehm closed this as completed Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants