4474 Commits

Author SHA1 Message Date
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
sophia
e90c7a508f
go generate 2022-04-25 12:26:49 -05:00
Paul Hinze
a4f426d26e
Modify SSH utils server mode behavior so ssh -c works
Still work left to do on exec and stderr separation but this represents
enough working to let vagrant-spec assertions pass so I think it's worth a
checkpoint!
2022-04-25 12:26:48 -05:00
Paul Hinze
fda2bcf0cd
Refactor SSHRun action to make room for remote overrides 2022-04-25 12:26:48 -05:00
Paul Hinze
6471a5a310
Refactor Util::SSH to make room for remote overrides
Splitting out methods gives us a place to hook in appropriate behavior
for when we're running in a GRPC server.
2022-04-25 12:26:48 -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
128599ab68
Get local box metadata in remote box 2022-04-25 12:26:47 -05:00
sophia
29d5b3627d
Always assume machine entry is valid on the ruby side 2022-04-25 12:26:46 -05:00
sophia
f55da8168a
Check if a box is in use using the machines endpoint
This returns a list of machine index entries that use the box. This
is what is expected from the Ruby side.
2022-04-25 12:26:46 -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
f1aec2c1c2
Return machine name as sym 2022-04-25 12:26:46 -05:00
sophia
bc641209e8
Check for box version 2022-04-25 12:26:46 -05:00
sophia
d9bcdba830
go generate 2022-04-25 12:26:45 -05:00
sophia
3516aa7131
Set defailt Vagrant log level 2022-04-25 12:26:44 -05:00
sophia
5d348e66a1
Update box proto to use struct for metadata 2022-04-25 12:26:44 -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
Paul Hinze
2906d2c7df
Populate default when synced folder guest type is not set
This helps fix the unit tests that were failing. Also adding a test for
the new behavior
2022-04-25 12:26:44 -05:00
sophia
1441ea74d2
Get sf type from folders 2022-04-25 12:26:43 -05:00
Chris Roberts
6fe6ee3221
Generated proto update 2022-04-25 12:26:43 -05:00
Chris Roberts
535f82e192
Update remote UI implementation to retain formatting 2022-04-25 12:26:43 -05:00
Chris Roberts
2ec4bb1a13
Add remote override for #ask method 2022-04-25 12:26:42 -05:00
Chris Roberts
ee9af88606
Pass message as string instead of array 2022-04-25 12:26:42 -05:00
Chris Roberts
50a7a578d3
Use initialization args for cache key 2022-04-25 12:26:39 -05:00
Chris Roberts
6d0e08942b
Convert error logger message to warn 2022-04-25 12:26:39 -05:00
Chris Roberts
0a676fd3f1
Remove local provider class replacement in machine 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
Paul Hinze
8b6ef27a0f
Fix multiple synced folder handling in server mode
There was a hash assignment that was overriding values when there were
multiple synced folders for a given implementation.

Includes some stub-tastic unit tests to help verify the hash munging
behavior does what it's supposed to do going forward.
2022-04-25 12:26:37 -05:00
Chris Roberts
bdf8527ab0
Generated proto update 2022-04-25 12:26:36 -05:00
Chris Roberts
7cb620da23
Remove method which is no longer used 2022-04-25 12:26:36 -05:00
Chris Roberts
bcff6d6284
Re-enable using local provider from machine 2022-04-25 12:26:35 -05:00
Chris Roberts
a5b3ca9f6d
Return remote plugin instances 2022-04-25 12:26:35 -05:00
Chris Roberts
4a9d501823
Remove module injection on V2 plugins 2022-04-25 12:26:35 -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