154 Commits

Author SHA1 Message Date
Chris Roberts
e958c6183a Adds initial HCP config support
Adds initial basic support for HCP based configuration in vagrant-go.
The initalization process has been updated to remove Vagrantfile parsing
from the client, moving it to the runner using init jobs for the basis
and the project (if there is one). Detection is done on the file based
on extension for Ruby based parsing or HCP based parsing.

Current HCP parsing is extremely simple and currently just a base to
build off. Config components will be able to implement an `Init`
function to handle receiving configuration data from a non-native source
file. This will be extended to include a default approach for injecting
defined data in the future.

Some cleanup was done in the state around validations. Some logging
adjustments were applied on the Ruby side for better behavior
consistency.

VirtualBox provider now caches locale detection to prevent multiple
checks every time the driver is initialized.
2023-09-07 17:26:10 -07:00
Chris Roberts
a7135c000b Apply license adjustments and fixes
Add configuration file for automated license modifications, remove
automated licese modifications from specific locations, and update the
license set in the gem specification.
2023-08-10 17:05:19 -07:00
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
Chris Roberts
f42269c584 Generated proto updates 2023-06-05 14:18:06 -07:00
sophia
d958b15352 go generate to pick up input color changes 2022-09-23 16:22:29 -04:00
sophia
e96738bf43 Add protos for supporting colored terminal line events 2022-09-14 11:41:30 -04:00
Paul Hinze
7c56c74bb6
Support and honor the "primary" option for Command plugins 2022-07-27 11:36:04 -05:00
Chris Roberts
dca389eda0 Generated proto updates 2022-07-25 15:00:49 -07:00
Paul Hinze
957d0d3779
Bring plugin options back to Ruby for providers and synced folders
This removes the need for the validation workaround for Docker, because
box_updated is once again available in that context.

We don't technically need the SyncedFolder priorities back on the Ruby
side, but wiring them through for symmetry.

Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/183
2022-07-15 12:14:47 -05:00
Chris Roberts
a7d3652920 Generated proto update 2022-07-11 15:10:03 -07:00
Chris Roberts
4dd69a07a3 Generated proto updates for vagrantfile 2022-07-08 16:38:02 -07:00
Paul Hinze
ee8883153c
Make Docker provider work again post config refactor
- Allow machine.box to be empty without sadness (depends on
   https://github.com/hashicorp/vagrant-plugin-sdk/pull/182)
 - Get synced folder type from plugin name instead of defaulting to
   :virtualbox
2022-07-08 11:36:27 -05:00
Sophia Castellarin
66a22e5254
Merge pull request #303 from hashicorp/synced_folder_has_override_opts
Synced folder has override opts
2022-07-07 16:28:14 -05:00
Chris Roberts
f5d778d51a Revert "Merge pull request #300 from hashicorp/optimize-ruby-command-list"
This reverts commit 1c26a4abb0c9e095b3f6ec9944c4b15f6f1cd064, reversing
changes made to 186824a568583d8f6f2a50501d940ed71608fa0b.

The changes broke plugin loading when using subcommands so these
changes will be reverted until the underlying issue can be
investigated and resolved.
2022-07-07 14:03:56 -07:00
sophia
9043ab4c45 go generate 2022-07-07 12:30:24 -05:00
sophia
e8c0587c85 go generate 2022-07-07 12:30:24 -05:00
Chris Roberts
1c26a4abb0
Merge pull request #300 from hashicorp/optimize-ruby-command-list
Optimize command list generation
2022-07-07 09:29:15 -07:00
Paul Hinze
fb2a102c71
Fix init and other commands that run without a project
The Basis needs to be able to respond to Vagrantfile() and
DefaultProvider() to make it through Vagrant::Environment
initialization.

Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/178
2022-07-01 11:56:08 -05:00
Chris Roberts
e1d7962ee8 Generated proto updates for get commands 2022-06-29 16:14:01 -07:00
Chris Roberts
f1695b6c1f Generated proto updates for config wrappers 2022-06-24 18:28:10 -07:00
Chris Roberts
83467013e9 Handle Set and Logger types 2022-06-20 16:56:30 -07:00
Chris Roberts
e0d8fa6689 Generated proto updates 2022-06-20 13:13:06 -07:00
sophia
ec2e2a6e89 go generate 2022-06-08 10:30:46 -05:00
sophia
90825f7086 go generate 2022-06-08 10:30:46 -05:00
Paul Hinze
8b08b3117c
Use plugin options for Synced Folder priorities
Now that plugin options are available, we can use them to interpret
synced folder priorities and remove the shim we had in place.
2022-06-06 17:39:09 -05:00
Paul Hinze
8dbe72a5a0
Use Component Options to implement ProviderOptions
* Populates ComponentOptions into plugin structs
* Maps options for legacy Provider Plugins into PluginOptions
* Demos use of PluginOptions in a stub provider
* Honors plugin priority and defaultable settings
2022-06-03 16:37:05 -05:00
sophia
4ffe33461c go generate . 2022-05-31 15:47:27 -05:00
Paul Hinze
06350a7afc
Port default provider selection
- Pulls in the SDK changes to Project.DefaultProvider and Project.Target
- Implements the hefty default provider method
- Un-hard-codes provider from Target, and sets it when a Target is
  looked up from a Project
2022-05-25 16:19:50 -05:00
sophia
dc1687e1ab go generate 2022-05-17 15:03:24 -05:00
sophia
0a37521ef2 Remove reload machine function from the grpc api 2022-05-04 09:32:36 -05:00
Chris Roberts
bbf7e0fb12 Generated proto updates 2022-04-25 16:12:38 -07:00
sophia
3b8bf20b48 go generate 2022-04-25 14:12:28 -05:00
sophia
875c44b324
go generate 2022-04-25 12:26:58 -05:00
sophia
cddcfef0a1
Update Box#UpdateInfo to use box metadata client 2022-04-25 12:26:57 -05:00
sophia
495902a5df
go generate 2022-04-25 12:26:57 -05:00
Chris Roberts
a8edd7a031
Generated proto update 2022-04-25 12:26:56 -05:00
sophia
03ecb877e6
Update box metadata Name endpoint to boxName 2022-04-25 12:26:53 -05:00
sophia
7f099bc30d
go generate 2022-04-25 12:26:53 -05:00
sophia
33c9d23a2e
go generate 2022-04-25 12:26:52 -05:00
sophia
84a6950c9e
go generate 2022-04-25 12:26:52 -05:00
sophia
7dd3649d73
Update Symbol proto mappers 2022-04-25 12:26:51 -05:00
sophia
a0cec28849
go generate 2022-04-25 12:26:50 -05:00
sophia
e90c7a508f
go generate 2022-04-25 12:26:49 -05:00
sophia
b62bdd8efb
Add missing Target states to proto 2022-04-25 12:26:47 -05:00
Paul Hinze
8f9952089a
Fix commands that run without a project
Some commands like `vagrant init` and `vagrant box` should be able to
run successfully without a full Project available in VAGRANT_CWD (in
other words, they don't require that a valid Vagrantfile be available.)

Thus far we've been assuming that a Project is available when
dispatching commands, which mean that commands of this nature weren't
working.

Here we make the Basis available to serve as an alternative client to
Vagrant::Environment::Remote such that it can be instantiated and passed
through to commands. This required some changes to Environment::Remote
to make its interactions with the client more defensive, but we manage
to avoid needing to make any changes to the normal legacy codepaths.
2022-04-25 12:26:47 -05:00
sophia
725f7a3b6e
go generate 2022-04-25 12:26:47 -05:00
sophia
30c75b4d4d
go generate 2022-04-25 12:26:46 -05:00
sophia
a39747cc59
go generate 2022-04-25 12:26:46 -05:00
sophia
d9bcdba830
go generate 2022-04-25 12:26:45 -05:00
sophia
5d348e66a1
Update box proto to use struct for metadata 2022-04-25 12:26:44 -05:00