Wrap disk feature in experimental flag

This commit is contained in:
Brian Cain 2019-11-22 13:50:41 -08:00
parent 86f9243762
commit f55aca091c
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
2 changed files with 10 additions and 0 deletions

View File

@ -433,6 +433,11 @@ module VagrantPlugins
# Add provider config
disk_config.add_provider_config(provider_options, &block)
if !Vagrant::Util::Experimental.feature_enabled?("disk_base_config")
@logger.warn("Disk config defined, but experimental feature is not enabled. To use this feature, enable it with the experimental flag `disk_base_config`. Disk will not be added to internal config, and will be ignored.")
return
end
@disks << disk_config
end

View File

@ -550,6 +550,11 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
end
describe "#disk" do
before(:each) do
allow(Vagrant::Util::Experimental).to receive(:feature_enabled?).
with("disk_base_config").and_return("true")
end
it "stores the disks" do
subject.disk(:disk, size: 100)
subject.disk(:disk, size: 1000, primary: false, name: "storage")