602 Commits

Author SHA1 Message Date
Paul Hinze
71cc8ee7bb
Fix some bugs in provider options handling
- Defaultable needs to default to true when it's not specified
- We need to allow a non-defaultable provider to be selected if it shows
  up in the config
2022-06-08 17:25:16 -05:00
sophia
0cdb63db58 Flush out http downloader 2022-06-08 10:30:46 -05:00
sophia
36081df049 Load filedownloader plugin 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
Paul Hinze
c60f82d22f
go generate w/ latest version of deps 2022-06-03 14:40:00 -05:00
sophia
194882214a Add machine readable bool endpoint to terminal ui 2022-05-31 15:47:47 -05:00
sophia
9ed92d2ab6 Recognize --machine-readable flag 2022-05-31 14:41:34 -05:00
sophia
079975fe2b Add machine readable flag 2022-05-31 10:09:35 -05:00
Paul Hinze
4d79c95177
Update tests and address one thing caught by them
Namely, the specified synced folder type should override the default type
2022-05-25 17:56:40 -05:00
Paul Hinze
25fcf61364
Sort synced folder plugins by priority and honor allowed setting
It turns out that synced folder plugins aren't returned in a consistent
order, which was causing all kinds of mayhem.

We can tone down that mayhem by implementing a shim of priority sorting
the plugins. This shim can be removed once we have proper priority
registration in the SDK.
2022-05-25 16:19:50 -05:00
Paul Hinze
88822f5a96
Override provider for all non-active targets
Instead of only targets with empty providers. This helps address a
problem that @soapy1 found in review where machines that failed to come
up would get stuck with the wrong provider.
2022-05-25 16:19:50 -05:00
Paul Hinze
823b6d366c
More conservative nil checking on WithProvider to prevent panics 2022-05-25 16:19:50 -05:00
sophia
8801e030b7
Get default synced folder type
(cherry picked from commit cd6baafb9238a58e992519e0576565d1a57bf8f5)
(but modified to work)
2022-05-25 16:19:50 -05:00
Paul Hinze
52ed086644
Change TargetIndex to only search by uuid
Note this reverses a change made in
https://github.com/hashicorp/vagrant-ruby/pull/180 to attempt to address
issues losing track of machines. Further testing is in order to verify
we haven't re-broken that, but after discussion we agreed this is the
correct behavior for the index.
2022-05-25 16:19:50 -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
Paul Hinze
9f9b3855b9
Remove unused GetDefaultProvider impl 2022-05-25 16:19:50 -05:00
Sophia Castellarin
027a0b9afa
Merge pull request #278 from hashicorp/non-interactive
Rename --tty flag to --interactive
2022-05-25 16:16:31 -05:00
sophia
4f63043646 Rename --tty flag to --interactive 2022-05-25 16:10:27 -05:00
Paul Hinze
88957f71fb
tests: Add assertion to address review comment 2022-05-25 13:42:28 -05:00
Paul Hinze
5bd0ac371c
tests: Correct basis dir setup
I noticed we were still catching the default locations for dirs in test
and just appending a tempdir path inside of them. This fixes that and
ensures all test files are contained within the tmpdir.
2022-05-25 13:41:59 -05:00
Paul Hinze
625806f448
Don't delete machine datadir when SetId("") is called
Legacy's `Machine#id=()` has an important side effect when a nil ID is
specified - it clears the contents of the machine's DataDir.

We mirrored this behavior over to gogo, with a subtle difference - we
deleted the whole DataDir vs just its children.

It turns out the Docker provider relies on the DataDir being
cleared-but-not-removed by doing a SetId dance in its InitState action.
(see 1e6259dd00d702f83048c75c5c229ce6494c4c6e).

So here we need to mirror that behavior in order for the Docker provider
to work properly.
2022-05-25 13:41:48 -05:00
sophia
85362faaed Output deprecated message for --timestamp and --debug-timestamp flags 2022-05-24 12:11:08 -05:00
sophia
1137b9d467 Recognize debug flags 2022-05-24 12:11:08 -05:00
sophia
d062e03d97 Force all boolean flags to have a negative alias 2022-05-18 15:13:58 -05:00
sophia
dc1687e1ab go generate 2022-05-17 15:03:24 -05:00
sophia
887903c0e1 Set aliases for command flags 2022-05-17 14:06:04 -05:00
sophia
584e7d2913 Make flag --no-tty 2022-05-17 14:04:18 -05:00
sophia
108275de21 Set default values for flags 2022-05-16 16:19:40 -05:00
sophia
1b8246c28f Set base command flag data 2022-05-16 14:56:22 -05:00
sophia
df25af809c Use no-tty flag 2022-05-16 13:52:52 -05:00
sophia
26fac3e1d9 Setup noninteractive ui for the base command if the --no-tty falg is provided 2022-05-13 16:49:30 -05:00
sophia
7a999d1f06 Add tty flag and set noninteractive terminal 2022-05-13 13:46:36 -05:00
sophia
bb30ff94ff Don't refresh the project more then necessary
The project does not need to be retreived from the db every time
it is queried for data. However, it does need to be updated whenever
a target is initialized from the project (eg. an upsert machine
action happens). This is because upserting a target will update the
associated project. Leaving the core.Project with stale data
unless it is refreshed.
2022-05-10 15:24:14 -05:00
sophia
b0b3dc2a47 Remove unused target fields 2022-05-04 11:25:56 -05:00
sophia
da3ab7f9b3 Refresh project when querying for project info
It is not guaranteed which project is ever being used. So whenever
some project property is queried make sure to refresh the project
by getting the latest one from the database.
2022-05-04 11:23:46 -05:00
sophia
053d658e52 Get default provider from go side
For now the go side will just return a hard coded value for the
default provider. It should be implementing the algorithm defined
at https://www.vagrantup.com/docs/providers/basic_usage.html#default-provider
2022-05-04 11:23:12 -05:00
sophia
6d1359b1f0 Get Provider from target 2022-05-04 11:22:41 -05:00
sophia
07e3f7e804 Fix machine state tests 2022-05-04 09:45:51 -05:00
sophia
0a37521ef2 Remove reload machine function from the grpc api 2022-05-04 09:32:36 -05:00
sophia
6dfca17d54 Get machine state from go impl 2022-05-04 09:32:36 -05:00
sophia
b4fbf76a33 Plug machine#uid methods into remote go backend 2022-05-04 09:32:36 -05:00
sophia
692dcb1b92 Allow testing plugins to have parent plugins 2022-05-02 16:50:01 -05:00
sophia
d135f24f49 Add target specialization tests 2022-05-02 15:52:36 -05:00
sophia
85ea3c3d1f Update machine tests 2022-05-02 15:36:47 -05:00
sophia
33ecb07156 Refactor mocks to be wrapped by testing plugin objects 2022-05-02 15:36:01 -05:00
sophia
8df560d659 Set mock guest/host plugin name 2022-05-02 15:31:41 -05:00
sophia
852a87f9d0 Add mock behaviour for getting seeds 2022-05-02 14:56:27 -05:00
sophia
b381487dd2 Use testing plugins to populate testing plugin manager 2022-05-02 14:52:41 -05:00
sophia
c712afad8f Update testing plugins 2022-05-02 12:33:18 -05:00