113 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
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
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
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
9043ab4c45 go generate 2022-07-07 12:30:24 -05:00
sophia
e8c0587c85 go generate 2022-07-07 12:30:24 -05: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
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
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
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
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
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
Paul Hinze
7c1d2e5368
Use optional fields on Synced Folder instead of empty string checks
Addresses concerns raised in discussion here
https://github.com/hashicorp/vagrant-ruby/pull/219#discussion_r816966056
and makes it so we don't have to change any plugin code to make things
work.

Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/133
2022-04-25 12:26:44 -05:00
Chris Roberts
6fe6ee3221
Generated proto update 2022-04-25 12:26:43 -05:00
Chris Roberts
bdf8527ab0
Generated proto update 2022-04-25 12:26:36 -05:00
sophia
231c99b133
go generate . 2022-04-25 12:26:33 -05:00
sophia
1f632d076c
go generate after rebase 2022-04-25 12:26:33 -05:00
sophia
1217189616
go generate 2022-04-25 12:26:32 -05:00
sophia
764f5c96c5
go generate 2022-04-25 12:26:32 -05:00
Chris Roberts
1c3afc0fc9
Generated proto update 2022-04-25 12:26:32 -05:00
Chris Roberts
2acd0fa3b8
Generated proto updates 2022-04-25 12:26:30 -05:00
sophia
bf8b7f6508
go generate 2022-04-25 12:26:27 -05:00
sophia
5fda271283
go generate . 2022-04-25 12:26:23 -05:00
Paul Hinze
92c345b42d
Allow go push plugins to use config from Vagrantfile
* Populate push configs when parsing the vagrantfile
* Allow untyped configs to be shipped over GRPC
* In our demo plugin, walk the vagrantfile and snag the config

Example Vagrantfile that works with the demo plugin:

```ruby
Vagrant.configure("2") do |config|
  config.push.define "myplugin" do |push|
    push.coolkey = "coolvalue"
    push.alist = ["so", "many", "items"]
    push.ahash = { "hashkey" => "hashvalue" }
  end
end

```
2022-04-25 12:26:21 -05:00
Paul Hinze
0fef7cc416
Port push plugins
This uses the new Push plugin support added to the plugin SDK in https://github.com/hashicorp/vagrant-plugin-sdk/pull/106 to make the following changes:

 * The plugin manager on the Go side now registers push plugins
 * The the _remote_ plugin manager on the Ruby side now calls over to
   the go side to get push plugins
 * All the wiring is hooked up such that when a push plugin is replaced
   with its remote GRPC-client-wielding equivalent, the messages are
   ferried around.
2022-04-25 12:26:21 -05:00