15702 Commits

Author SHA1 Message Date
sophia
32bb18e9b9 Only output machine readable data if the terminal is not interactive 2022-05-31 10:53:21 -05:00
sophia
65e851d646 Output machine readable data as table 2022-05-31 10:28:26 -05:00
sophia
313ba8655a Implement missing ui#machine method 2022-05-31 10:09:36 -05:00
sophia
58e8e6ff97 Remove unused machine initialization steps 2022-05-31 10:09:35 -05:00
sophia
079975fe2b Add machine readable flag 2022-05-31 10:09:35 -05:00
Paul Hinze
f21f76b41d
Merge pull request #268 from hashicorp/port-default-provider
Port default provider
2022-05-27 13:17:30 -05:00
Paul Hinze
6f9ea74e0e
Mark box_optional test as temporarily pending 2022-05-26 11:16:45 -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
41933e9c11
Bump SDK 2022-05-25 16:19:51 -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
Paul Hinze
49aa226613
Temporary workaround to let Docker provider work
Comment has the details, but this should hopefully be short lived
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
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
Paul Hinze
e605132321
Pass along provider to environment.target
Mirrors change in https://github.com/hashicorp/vagrant-plugin-sdk/pull/157
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
f221614187
Fix duplicate guess_provider call
No reason to call it twice when it's already being stored in a local
variable that's unmodified.

Also document the params for this method to help lay the groundwork for
porting.
2022-05-25 16:19:50 -05:00
Paul Hinze
9f9b3855b9
Remove unused GetDefaultProvider impl 2022-05-25 16:19:50 -05:00
Paul Hinze
16cd665257
gitignore: delve, solargraph, rubocop 2022-05-25 16:19:50 -05:00
Paul Hinze
102e100108
client/target_index: Make yard comments conformant 2022-05-25 16:19:49 -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
536627b9e7
Merge pull request #272 from hashicorp/ci-run-docker-tests-with-gogo
ci: Run docker tests with gogo
2022-05-25 14:50:45 -05:00
Paul Hinze
ea04133b9d
Merge pull request #274 from hashicorp/set-id-datadir
Don't delete machine datadir when SetId("") is called
2022-05-25 14:48:31 -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 Castellarin
e2bd70bb77
Merge pull request #275 from hashicorp/debug-flags
Debug flags
2022-05-24 12:14:53 -05:00
sophia
a34fab6e5e Bump sdk 2022-05-24 12:11:52 -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 Castellarin
c4b3a77482
Merge pull request #273 from hashicorp/no-tty-ui
Use non interactive ui when `--no-tty` flag provided
2022-05-24 12:10:46 -05:00
sophia
bad86ca986 Bump sdk 2022-05-24 09:32:40 -05:00
sophia
2c0f43db3b Make flags that are only defined as --no- work 2022-05-23 11:41:08 -05:00
sophia
0b6781444a Resolve issue with Vagrant core providing more flag options than Vagrant legacy
This occurs when boolean flags in legacy Vagrant does
not define both a positive and negative boolean flag.
For example, --force and --no-force flags
2022-05-18 15:49:17 -05:00
sophia
d062e03d97 Force all boolean flags to have a negative alias 2022-05-18 15:13:58 -05:00
sophia
28beec7bad Set alias for boolean flags that have a 'no-' option 2022-05-17 15:04:07 -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
Paul Hinze
2adb438eee
ci: Ensure cleanup runs after notify completes
Without declaring it as a dependency the job can run in parallel and delete the workspace out from under the notify job.

Using format from this example: https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#example-not-requiring-successful-dependent-jobs
2022-05-16 17:50:00 -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
9094ac5869 Update donothing command to use localizer to just translate message 2022-05-16 13:51:57 -05:00
sophia
d708bab84a Add error message for errors originating from a remote 2022-05-13 17:14:50 -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
Paul Hinze
10b505cfad
ci: Run docker tests with gogo
They were running with Ruby... whoopsie
2022-05-13 16:41:19 -05:00