322 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
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
672a408dbc Isolate protobuf message loading to server mode
Prevent protobuf loading when not in server mode. This allows proper
loading on platforms which don't have support for the protobuf
libraries.
2022-12-16 16:21:06 -08:00
Paul Hinze
7c56c74bb6
Support and honor the "primary" option for Command plugins 2022-07-27 11:36:04 -05:00
Paul Hinze
313905dde5
Merge pull request #317 from hashicorp/fix-help-subcommand
Band-aid to prevent help subcommand from erroring
2022-07-15 16:42:13 -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
Paul Hinze
f3dbc24a22
Band-aid to prevent help subcommand from erroring
The code running in the help subcommand relies on Command plugins being
returned from the manager with their options hash. Stubbing in a blank
hash prevents the command from crashing

What we really need is for CommandOptions to be modeled and passed
through from Go to Ruby so :primary subcommands can be displayed, but
that can be a follow-on task from this quick fix.
2022-07-15 11:25:50 -05:00
sophia
73801703e7 Pass machine to provider capabilities 2022-07-07 11:49:57 -05:00
sophia
52d37217ac Use cache from CommandServe module 2022-06-30 16:57:41 -05:00
Chris Roberts
e47da98810 Update unset value constant 2022-06-15 11:02:29 -07:00
Chris Roberts
4128441aac Remove to_proto from config and update unset value constant 2022-06-15 11:02:29 -07:00
sophia
1ad8dc5234 Add command remote plugin 2022-06-01 14:36:19 -05:00
Paul Hinze
02a06bca45
Fixes for provider capability invocations
It looks like I might have been the first to hit provider cabability
invocation in testing these changes, and so I found these few missing
methods on the client. They're just copied over from the other
capability hosts.

Calling capabilities on a provider also revealed that the wrong Machine
type was being pulled out of the funcspec args, so we had to correct
that too in order to get the capability calls working.
2022-05-25 16:19:50 -05:00
Chris Roberts
81ec1173c2
Remove symbol transformation in config 2022-04-25 12:26:56 -05:00
sophia
9dcb9df7ff
Let mappers convert machine to proto opposed to client 2022-04-25 12:26:55 -05:00
sophia
9bf59a0d42
Rely on proto mappers to convert configs 2022-04-25 12:26:51 -05:00
sophia
436518e445
No need to stringify hash keys when using mappers 2022-04-25 12:26:51 -05:00
sophia
7dd3649d73
Update Symbol proto mappers 2022-04-25 12:26:51 -05:00
sophia
d5aacc0bc6
Thrash around making to proto for config faster 2022-04-25 12:26:51 -05:00
sophia
ccf2bf6197
Pass config as a SDK hash in order to use the Symbol proto 2022-04-25 12:26:51 -05:00
sophia
77a06e83d0
Close core plugins 2022-04-25 12:26:50 -05:00
sophia
b40dde3797
Module for core plugin manager mappers 2022-04-25 12:26:50 -05:00
sophia
afc6d1c27d
Extract core plugin manager from context 2022-04-25 12:26:50 -05:00
Chris Roberts
50a7a578d3
Use initialization args for cache key 2022-04-25 12:26:39 -05:00
Chris Roberts
924700e103
Support method passthru to local plugins 2022-04-25 12:26:38 -05:00
Chris Roberts
0ad82cf04a
Ensure all remote plugins handle client setup 2022-04-25 12:26:38 -05:00
Chris Roberts
7e9dad2b3e
Add remote host plugin 2022-04-25 12:26:38 -05:00
Paul Hinze
ff86d86ac8
Provisioner Plugins 2022-04-25 12:26:37 -05:00
Chris Roberts
e07a77f919
Update wrapper classes to use remote plugin classes 2022-04-25 12:26:35 -05:00
Chris Roberts
aa98e48e28
Update remote plugins to subclass V2 plugins 2022-04-25 12:26:35 -05:00
Chris Roberts
095a0f8847
WIP checkpoint with callable remote provider action 2022-04-25 12:26:35 -05:00
Chris Roberts
0cf2ea2eb6
Update wrapper initializer to use client from manager 2022-04-25 12:26:35 -05:00
Chris Roberts
3d05ff7ce0
Set client into remote manager on enable and remove on disable 2022-04-25 12:26:35 -05:00
Chris Roberts
070292fb3b
Add class level storage for remote manager client 2022-04-25 12:26:35 -05:00
Paul Hinze
e9426b7a89
Switch to constant stub and add explanatory comment 2022-04-25 12:26:34 -05:00
Paul Hinze
952ba920bc
Return a static priority w/ synced folders in remote manager
Callers expect the manager to return both the class and an integer
priority... so we get a bare minimum working by returning something
reasonable.
2022-04-25 12:26:34 -05:00
sophia
b6de8c3a80
Add guest detect function to client 2022-04-25 12:26:34 -05:00
sophia
56edbfa3b8
Add guest remote plugin module 2022-04-25 12:26:33 -05:00
sophia
87f8c9cc5e
Implement synced folder prepare endpoint 2022-04-25 12:26:33 -05:00
Chris Roberts
8867dfc33c
Accept options hash for action methods 2022-04-25 12:26:31 -05:00
sophia
81a9d7b241
Pass machine to provider functions 2022-04-25 12:26:24 -05:00
sophia
fcf405bdf8
Run provider actions 2022-04-25 12:26:24 -05:00
sophia
8355209654
Accept machine for provider state endpoint 2022-04-25 12:26:24 -05:00
sophia
1e428a0812
Add mappers for provider 2022-04-25 12:26:24 -05:00
sophia
809e4044a0
Add provider remote plugin module 2022-04-25 12:26:23 -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
Chris Roberts
d8e959c89f
Connect synced folder to client in _initialize method 2022-04-25 12:26:16 -05:00
Chris Roberts
031890fcc7
Allow plugin manager to be swapped out for remote manager 2022-04-25 12:26:15 -05:00
Chris Roberts
23d0d9debb
Provide client using keyword argument for synced folder 2022-04-25 12:26:14 -05:00
Chris Roberts
fb2319f1e2
Implement remote plugin manager backed by vagrant go 2022-04-25 12:26:14 -05:00