154 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
8e26495189 Project client and proc mapper fixes
Default the options for default provider so an options value is not
required when calling. The index for the proc lookup should use the key
method, not index.
2023-06-05 17:39:58 -07:00
Paul Hinze
7c56c74bb6
Support and honor the "primary" option for Command plugins 2022-07-27 11:36:04 -05:00
Chris Roberts
da9892a62f Use #to_proto on class match, otherwise convert 2022-07-11 15:09:46 -07:00
Chris Roberts
2572d4f62b Include class where error originated 2022-07-11 15:09:21 -07:00
Chris Roberts
e082fd6359 Machine mapper no longer needs to load through environment 2022-07-11 15:09:08 -07:00
sophia
f1af42a7fc Don't use hash with indifferent access when converting hash
The HashWithIndifferentAccess will change all keys to strings when
merged with another regular hash. This causes errors in cases where
hashes are merged, for example in the action builder. Symbol/String
type data is kept over the wire, so there is no need to make the
mapped hash a HashWithIndifferentAccess.
2022-07-07 11:50:03 -05:00
Chris Roberts
a2e0c5619e Use __finalized variable to determine finalization 2022-06-27 11:26:08 -07:00
Chris Roberts
0aad3390c9 Add funcspec mappers for finalize and merge wrappers 2022-06-24 18:29:53 -07:00
Chris Roberts
778d009bfb Mark configs with unique id. Use id for provisioner caching. 2022-06-22 12:33:07 -07:00
Chris Roberts
83467013e9 Handle Set and Logger types 2022-06-20 16:56:30 -07:00
Chris Roberts
70d725f8a0 Add support for origin value restrictions and custom weighting 2022-06-15 10:56:19 -07:00
Chris Roberts
53aae744a4 Allow callables to modify vertex weight 2022-06-15 10:56:19 -07:00
Chris Roberts
439546d58c Update input vertex to allow origin only setting 2022-06-15 10:56:19 -07:00
Chris Roberts
40cd6e8616 Allow marking inputs as only accepting origin value 2022-06-15 10:56:13 -07:00
Chris Roberts
9da90f0b21 Return false if RHS does not implement hash_code 2022-06-15 10:55:00 -07:00
Chris Roberts
45b9c48f03 Add Class to known types mapper. Indifferent access for hashes. 2022-06-15 10:55:00 -07:00
Chris Roberts
df3cc08b1f Add mappers for config data and procs 2022-06-15 10:55:00 -07:00
Chris Roberts
0a80ce1ea6 Remove config mappers from provisioner 2022-06-15 10:55:00 -07:00
Chris Roberts
a826287f34 Add mappers for the vagrantfile 2022-06-15 10:55:00 -07:00
Chris Roberts
2d5cb6b0fa Force the string proto value to be a string 2022-06-15 10:55:00 -07: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
sophia
ba1384eb88 Fix machine mappers 2022-05-04 11:51:43 -05:00
sophia
e020c6600e Hacks to let a remote machine be instantiated with or with out a client 2022-05-04 11:25:54 -05:00
sophia
92a0b1c541 Allow remote machine to be initialized with just a machine client 2022-05-04 11:23:06 -05:00
Chris Roberts
9ab74271cf
Add some comments and expand some method documentation 2022-04-25 12:26:57 -05:00
Chris Roberts
f220ac2f94
Add name based re-weight helper. Add documentation/comments. 2022-04-25 12:26:56 -05:00
Chris Roberts
f9e55a8f9d
Fill in vertex base methods 2022-04-25 12:26:56 -05:00
Chris Roberts
66c9fd45d6
Map key and value when converting Hash types 2022-04-25 12:26:56 -05:00
Chris Roberts
1bf4c8d090
Provide Graph#each_vertex helper to graph 2022-04-25 12:26:56 -05:00
Chris Roberts
12cb795392
Add name support for inputs 2022-04-25 12:26:56 -05:00
Chris Roberts
305fddb49a
Retry cached path executions with full graph 2022-04-25 12:26:55 -05:00
Chris Roberts
8cc6116cdf
Store previous successful lookups for future graph generation 2022-04-25 12:26:54 -05:00
Chris Roberts
aaed7b2d82
Update Method vertex hash code and allow callable access 2022-04-25 12:26:54 -05:00
Chris Roberts
3a6308b7fc
Use blocks for logging content to reduce processing 2022-04-25 12:26:54 -05:00
sophia
1f5d66fd76
Get box metadata client from box 2022-04-25 12:26:52 -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
b40dde3797
Module for core plugin manager mappers 2022-04-25 12:26:50 -05:00
sophia
05244e67c1
Add mappers for core plugin manager 2022-04-25 12:26:50 -05:00
Chris Roberts
ab8dee7a72
Add some missing mappers for converting to proto 2022-04-25 12:26:39 -05:00
Chris Roberts
b976be72bd
Simplify cacher 2022-04-25 12:26:37 -05:00
Paul Hinze
ff86d86ac8
Provisioner Plugins 2022-04-25 12:26:37 -05:00
Chris Roberts
4679d39039
Fix name and method call in folders mappers 2022-04-25 12:26:37 -05:00
Chris Roberts
c32ba38b70
Add mappers for Folders type 2022-04-25 12:26:36 -05:00
Chris Roberts
a5b3ca9f6d
Return remote plugin instances 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
Paul Hinze
8730b9f100
Fix MachineState mapper so IsRunning actions work
The IsRunning action checks if `env[:machine].state.id == :running` but
this check was never passing as the protobuf-washed version of machine
state was yielding a machine state w/ a string value like `"running"`.

Easy fix in the mapper!
2022-04-25 12:26:34 -05:00