4494 Commits

Author SHA1 Message Date
Paul Hinze
e5a75b78ec
Update Environment::Remote to match Environment changes
Since the `initialize` method is copied over, we need to mirror changes
from #250 into that copy
2022-04-25 12:26:55 -05:00
Paul Hinze
2707d09181
Fix prepend/append action hooks firing multiple times
This addresses the surprising behavior that the StoreBoxMetadata hook
was running many times during a machine up, including during failed
operations where a destroy_on_error deleted the machine. This was
resulting in an error that looked like:

> No such file or directory @ rb_sysopen [...] /[...]/box_meta

Plugin action hooks using prepend/append were attaching every time a
Builder was run, including sub-Builders that show up for things like
Call actions.

To fix this, we tell Builders if they are "primary" and only run
prepend/append on those. See inline comments for more explanation.
2022-04-25 12:26:55 -05:00
sophia
9dcb9df7ff
Let mappers convert machine to proto opposed to client 2022-04-25 12:26:55 -05:00
sophia
7b470d4b25
Ensure box metadata has optional arguments 2022-04-25 12:26:53 -05:00
sophia
c464569794
Remove extra logging 2022-04-25 12:26:53 -05:00
sophia
8adbab2f22
Sort box metadata versions 2022-04-25 12:26:53 -05:00
sophia
03ecb877e6
Update box metadata Name endpoint to boxName 2022-04-25 12:26:53 -05:00
sophia
66524426d0
Update ruby remote box metadata for proto changes 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
428c3b02fd
Use remote box metadata implementation 2022-04-25 12:26:52 -05:00
sophia
84a6950c9e
go generate 2022-04-25 12:26:52 -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
f4811af759
Use symbol proto when protoizing plugin configs 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
a0cec28849
go generate 2022-04-25 12:26:50 -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
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