Skip to content

Commit

Permalink
Remove experimental checks
Browse files Browse the repository at this point in the history
Removes experimental checks on existing experimental features.
  • Loading branch information
chrisroberts committed Sep 8, 2023
1 parent a7135c0 commit 513be17
Show file tree
Hide file tree
Showing 23 changed files with 12 additions and 235 deletions.
6 changes: 2 additions & 4 deletions lib/vagrant/action/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,7 @@ def to_app(env)
# @param [Hash] env Call environment
# @return [Builder] self
def apply_dynamic_updates(env)
if Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
triggers = env[:triggers]
end
triggers = env[:triggers]

# Use a Hook as a convenient interface for injecting
# any applicable trigger actions within the stack
Expand Down Expand Up @@ -299,7 +297,7 @@ def apply_action_name(env)
machine_name = env[:machine].name if env[:machine]

# Start with loading any hook triggers if applicable
if Vagrant::Util::Experimental.feature_enabled?("typed_triggers") && env[:triggers]
if env[:triggers]
if !env[:triggers].find(env[:action_name], :before, machine_name, :hook).empty?
hook.prepend(Vagrant::Action::Builtin::Trigger,
env[:action_name], env[:triggers], :before, :hook)
Expand Down
13 changes: 0 additions & 13 deletions lib/vagrant/action/warden.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ class Warden
attr_accessor :actions, :stack

def initialize(actions, env)
if Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
if env[:trigger_env]
@env = env[:trigger_env]
else
@env = env[:env]
end

machine = env[:machine]
machine_name = machine.name if machine
ui = Vagrant::UI::Prefixed.new(@env.ui, "vagrant")
@triggers = Vagrant::Plugin::V2::Trigger.new(@env, @env.vagrantfile.config.trigger, machine, ui)
end

@stack = []
@actions = actions.map { |m| finalize_action(m, env) }.flatten
@logger = Log4r::Logger.new("vagrant::action::warden")
Expand Down
12 changes: 4 additions & 8 deletions lib/vagrant/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ def initialize(argv, env)
@logger = Log4r::Logger.new("vagrant::cli")
@main_args, @sub_command, @sub_args = split_main_and_subcommand(argv)

if Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
ui = Vagrant::UI::Prefixed.new(env.ui, "vagrant")
@triggers = Vagrant::Plugin::V2::Trigger.new(env, env.vagrantfile.config.trigger, nil, ui)
end
ui = Vagrant::UI::Prefixed.new(env.ui, "vagrant")
@triggers = Vagrant::Plugin::V2::Trigger.new(env, env.vagrantfile.config.trigger, nil, ui)

Util::CheckpointClient.instance.setup(env).check
@logger.info("CLI: #{@main_args.inspect} #{@sub_command.inspect} #{@sub_args.inspect}")
Expand Down Expand Up @@ -65,11 +63,9 @@ def execute
# Initialize and execute the command class, returning the exit status.
result = 0
begin
@triggers.fire(@sub_command, :before, nil, :command) if
Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
@triggers.fire(@sub_command, :before, nil, :command)
result = command_class.new(@sub_args, @env).execute
@triggers.fire(@sub_command, :after, nil, :command) if
Vagrant::Util::Experimental.feature_enabled?("typed_triggers")
@triggers.fire(@sub_command, :after, nil, :command)
rescue Interrupt
@env.ui.info(I18n.t("vagrant.cli_interrupt"))
result = 1
Expand Down
4 changes: 0 additions & 4 deletions lib/vagrant/machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ def action(name, opts=nil)

# Extra env keys are the remaining opts
extra_env = opts.dup
# An environment is required for triggers to function properly. This is
# passed in specifically for the `#Action::Warden` class triggers. We call it
# `:trigger_env` instead of `env` in case it collides with an existing environment
extra_env[:trigger_env] = @env

check_cwd # Warns the UI if the machine was last used on a different dir

Expand Down
18 changes: 2 additions & 16 deletions plugins/kernel_v2/config/vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,8 @@ def provision(name, **options, &block)
after = options.delete(:after)
end

if Vagrant::Util::Experimental.feature_enabled?("dependency_provisioners")
opts = {before: before, after: after}
prov = VagrantConfigProvisioner.new(name, type.to_sym, **opts)
else
prov = VagrantConfigProvisioner.new(name, type.to_sym)
end
opts = {before: before, after: after}
prov = VagrantConfigProvisioner.new(name, type.to_sym, **opts)
@provisioners << prov
end

Expand Down Expand Up @@ -479,11 +475,6 @@ def disk(type, **options, &block)
# Add provider config
disk_config.add_provider_config(**provider_options, &block)

if !Vagrant::Util::Experimental.feature_enabled?("disks")
@logger.warn("Disk config defined, but experimental feature is not enabled. To use this feature, enable it with the experimental flag `disks`. Disk will not be added to internal config, and will be ignored.")
return
end

@disks << disk_config
end

Expand All @@ -504,11 +495,6 @@ def cloud_init(type=nil, **options, &block)
cloud_init_config.set_options(options)
end

if !Vagrant::Util::Experimental.feature_enabled?("cloud_init")
@logger.warn("cloud_init config defined, but experimental feature is not enabled. To use this feature, enable it with the experimental flag `cloud_init`. cloud_init config will not be added to internal config, and will be ignored.")
return
end

@cloud_init_configs << cloud_init_config
end

Expand Down
2 changes: 0 additions & 2 deletions plugins/providers/hyperv/cap/cleanup_disks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ module CleanupDisks
def self.cleanup_disks(machine, defined_disks, disk_meta_file)
return if disk_meta_file.values.flatten.empty?

return if !Vagrant::Util::Experimental.feature_enabled?("disks")

handle_cleanup_disk(machine, defined_disks, disk_meta_file["disk"])
# TODO: Floppy and DVD disks
end
Expand Down
2 changes: 0 additions & 2 deletions plugins/providers/hyperv/cap/configure_disks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ module ConfigureDisks
def self.configure_disks(machine, defined_disks)
return {} if defined_disks.empty?

return {} if !Vagrant::Util::Experimental.feature_enabled?("disks")

machine.ui.info(I18n.t("vagrant.cap.configure_disks.start"))

current_disks = machine.provider.driver.list_hdds
Expand Down
2 changes: 0 additions & 2 deletions plugins/providers/virtualbox/cap/cleanup_disks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ module CleanupDisks
def self.cleanup_disks(machine, defined_disks, disk_meta_file)
return if disk_meta_file.values.flatten.empty?

return if !Vagrant::Util::Experimental.feature_enabled?("disks")

handle_cleanup_disk(machine, defined_disks, disk_meta_file["disk"])
handle_cleanup_dvd(machine, defined_disks, disk_meta_file["dvd"])
# TODO: Floppy disks
Expand Down
2 changes: 0 additions & 2 deletions plugins/providers/virtualbox/cap/configure_disks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ module ConfigureDisks
def self.configure_disks(machine, defined_disks)
return {} if defined_disks.empty?

return {} if !Vagrant::Util::Experimental.feature_enabled?("disks")

machine.ui.info(I18n.t("vagrant.cap.configure_disks.start"))

storage_controllers = machine.provider.driver.read_storage_controllers
Expand Down
4 changes: 0 additions & 4 deletions website/content/docs/cloud-init/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ description: Introduction to using cloud-init with Vagrant

# Vagrant cloud-init

~> **Warning!** This feature is experimental and may break or
change in between releases. Use at your own risk. It currently is not officially
supported or functional.

For examples on how to achieve this, among other use cases, please refer to the [usage](/vagrant/docs/cloud-init/usage)
guide for more information!

Expand Down
15 changes: 0 additions & 15 deletions website/content/docs/cloud-init/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ description: Various Vagrant Cloud-Init examples

# Basic Usage

~> **Warning!** This feature is experimental and may break or
change in between releases. Use at your own risk. It currently is not officially
supported or functional.

This feature currently requires the experimental flag to be used. To explicitly enable this feature, you can set the experimental flag to:

```
VAGRANT_EXPERIMENTAL="cloud_init,disks"
```

Please note that `VAGRANT_EXPERIMENTAL` is an environment variable. For more
information about this flag visit the [Experimental docs page](/vagrant/docs/experimental)
for more info. Without this flag enabled, any cloud-init configs defined will
not be configured.

Also note that the examples below use the VirtualBox provider, which is the current
supported provider for this feature.

Expand Down
14 changes: 0 additions & 14 deletions website/content/docs/disks/hyperv/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ description: |-

# Hyper-V

~> **Warning!** This feature is experimental and may break or
change in between releases. Use at your own risk. It currently is not officially
supported.

This feature currently requires the experimental flag to be used. To explicitly enable this feature, you can set the experimental flag to:

```
VAGRANT_EXPERIMENTAL="disks"
```

Please note that `VAGRANT_EXPERIMENTAL` is an environment variable. For more
information about this flag visit the [Experimental docs page](/vagrant/docs/experimental/)
for more info. Without this flag enabled, any disks defined will not be configured.

Because of how Hyper-V handles disk management, a Vagrant guest _must_ be powered
off for any changes to be applied to a guest. If you make a configuration change
with a guests disk, you will need to `vagrant reload` the guest for any changes
Expand Down
14 changes: 0 additions & 14 deletions website/content/docs/disks/hyperv/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ description: |-

# Usage

~> **Warning!** This feature is experimental and may break or
change in between releases. Use at your own risk. It currently is not officially
supported.

This feature currently requires the experimental flag to be used. To explicitly enable this feature, you can set the experimental flag to:

```
VAGRANT_EXPERIMENTAL="disks"
```

Please note that `VAGRANT_EXPERIMENTAL` is an environment variable. For more
information about this flag visit the [Experimental docs page](/vagrant/docs/experimental/)
for more info. Without this flag enabled, any disks defined will not be configured.

For examples of how to use the disk feature with Hyper-V, please refer to the
[general disk usage guide](/vagrant/docs/disks/usage) for more examples.

Expand Down
5 changes: 0 additions & 5 deletions website/content/docs/disks/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ description: Introduction to Vagrant Disks

# Vagrant Disks

~> **Warning!** This feature is experimental and may break or
change in between releases. Use at your own risk. It currently is not officially
supported. Please refer to the provider specific disk documentation
for more information on how to use and enable this feature.

Vagrant Disks is a feature that allows users to define what mediums should be attached
to their guests, as well as allowing users to resize their primary disk.

Expand Down
14 changes: 0 additions & 14 deletions website/content/docs/disks/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,6 @@ description: Various Vagrant Disk examples

# Basic Usage

~> **Warning!** This feature is experimental and may break or
change in between releases. Use at your own risk. It currently is not officially
supported.

This feature currently requires the experimental flag to be used. To explicitly enable this feature, you can set the experimental flag to:

```
VAGRANT_EXPERIMENTAL="disks"
```

Please note that `VAGRANT_EXPERIMENTAL` is an environment variable. For more
information about this flag visit the [Experimental docs page](/vagrant/docs/experimental/)
for more info. Without this flag enabled, any disks defined will not be configured.

Below are some very simple examples of how to use Vagrant Disks with the VirtualBox provider.

## Basic Examples
Expand Down
14 changes: 0 additions & 14 deletions website/content/docs/disks/virtualbox/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ description: |-

# VirtualBox

~> **Warning!** This feature is experimental and may break or
change in between releases. Use at your own risk. It currently is not officially
supported.

This feature currently requires the experimental flag to be used. To explicitly enable this feature, you can set the experimental flag to:

```
VAGRANT_EXPERIMENTAL="disks"
```

Please note that `VAGRANT_EXPERIMENTAL` is an environment variable. For more
information about this flag visit the [Experimental docs page](/vagrant/docs/experimental/)
for more info. Without this flag enabled, any disks defined will not be configured.

**Vagrant currently only supports VirtualBox version 5.x and newer for configuring and
attaching disks.**

Expand Down
14 changes: 0 additions & 14 deletions website/content/docs/disks/virtualbox/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ description: |-

# Usage

~> **Warning!** This feature is experimental and may break or
change in between releases. Use at your own risk. It currently is not officially
supported.

This feature currently requires the experimental flag to be used. To explicitly enable this feature, you can set the experimental flag to:

```
VAGRANT_EXPERIMENTAL="disks"
```

Please note that `VAGRANT_EXPERIMENTAL` is an environment variable. For more
information about this flag visit the [Experimental docs page](/vagrant/docs/experimental/)
for more info. Without this flag enabled, any disks defined will not be configured.

For examples of how to use the disk feature with VirtualBox, please refer to the
[general disk usage guide](/vagrant/docs/disks/usage) for more examples.

Expand Down
14 changes: 0 additions & 14 deletions website/content/docs/disks/vmware/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@ description: |-

# VMware

~> **Warning!** This feature is experimental and may break or
change in between releases. Use at your own risk. It currently is not officially
supported.

This feature currently requires the experimental flag to be used. To explicitly enable this feature, you can set the experimental flag to:

```
VAGRANT_EXPERIMENTAL="disks"
```

Please note that `VAGRANT_EXPERIMENTAL` is an environment variable. For more
information about this flag visit the [Experimental docs page](/vagrant/docs/experimental/)
for more info. Without this flag enabled, any disks defined will not be configured.

Because of how VMware handles disk management, a Vagrant guest _must_ be powered
off for any changes to be applied to a guest. If you make a configuration change
with a guests disk, you will need to `vagrant reload` the guest for any changes
Expand Down
14 changes: 0 additions & 14 deletions website/content/docs/disks/vmware/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@ description: |-

# Usage

~> **Warning!** This feature is experimental and may break or
change in between releases. Use at your own risk. It currently is not officially
supported.

This feature currently requires the experimental flag to be used. To explicitly enable this feature, you can set the experimental flag to:

```
VAGRANT_EXPERIMENTAL="disks"
```

Please note that `VAGRANT_EXPERIMENTAL` is an environment variable. For more
information about this flag visit the [Experimental docs page](/vagrant/docs/experimental/)
for more info. Without this flag enabled, any disks defined will not be configured.

For examples of how to use the disk feature with VMWware, please refer to the
[general disk usage guide](/vagrant/docs/disks/usage) for more examples.

Expand Down
23 changes: 1 addition & 22 deletions website/content/docs/experimental/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,4 @@ started with Vagrant, you may safely skip this section.

This is a list of all the valid experimental features that Vagrant recognizes:

### `cloud_init`

Enabling this feature allows Vagrant to use the `cloud-init` feature. More
information about these options can be found on the [cloud-init documentation page](/vagrant/docs/cloud-init/usage)

### `dependency_provisioners`

Enabling this feature allows all provisioners to specify `before` and `after`
options. These options allow provisioners to be configured to run before or after
any given "root" provisioner. More information about these options can be found
on the [base provisioner documentation page](/vagrant/docs/provisioning/basic_usage)

### `disks`

Enabling this feature will allow Vagrant to manage and configure virtual hard disks
for certain providers. More information about supported providers and how to
configure disks can be found on the [disk documentation page](/vagrant/docs/disks)

### `typed_triggers`

Enabling this feature allows triggers to recognize and execute `:type` triggers.
More information about how these should be used can be found on the [trigger documentation page](/vagrant/docs/triggers/configuration#trigger-types)
There are currently no experimental features
Loading

0 comments on commit 513be17

Please sign in to comment.