20 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
739bb7703d Allow connection to close when process closes 2023-06-05 14:18:06 -07:00
Chris Roberts
4eff04d20f Enable foreign key constraints 2023-06-05 14:18:06 -07:00
Chris Roberts
b6192eba0d Fixup scoping usage to properly validate 2023-06-05 14:18:05 -07:00
Chris Roberts
1a0c6b9d70 Request ruby runtime to stop itself when closing 2022-07-25 15:00:49 -07:00
Chris Roberts
a0c78056d2 Add cleanup tasks individually 2022-06-20 12:55:18 -07:00
Paul Hinze
8b5d4b8631
Update and address protobuf package deprecations
These changes address the following warning showing up on `go get`
operations:

    go: module github.com/golang/protobuf is deprecated: Use the
    "google.golang.org/protobuf" module instead.

All changes are made using the recommendations in the per-function
deprecation notices from the docs at
https://pkg.go.dev/github.com/golang/protobuf/ptypes
2022-06-08 11:51:19 -05:00
Paul Hinze
4c21cb6ae5
Add release-grade logic for finding legacy Vagrant
After lots of experimentation I have landed on this as my proposal for
how we have our Go binary find its Ruby counterpart: just have it grab
it from the $PATH! @evanphx showed me this neat trick where by borrowing
a couple of helper methods from `exec` and tweaking them we can get
logic that will do a $PATH lookup that excludes "ourself". This allows
us to have both `vagrant` executables on the path... and means that
switching between Gogo-by-default or Legacy-by-default is just a matter
of tweaking $PATH order.

It _also_ means that we don't need any different lookup logic for
"release mode" vs "development mode" which is what I was looking at
before this solution.

In order to continue to facilitate development, I've generated a binstub
for vagrant using `bundle binstubs vagrant --standalone --path
./binstubs`, and I've updated the Nix development setup to prepend this
directory to the $PATH.

NOTE: Non-Nix users will need to modify their $PATH in the same way to
get the same behavior in development.
2022-04-25 12:26:49 -05:00
Chris Roberts
6b4e13c615
Use environment variable for logging level 2022-04-25 12:26:19 -05:00
sophia
d75f76edf7
Prune old jobs as part of vagrant server clean ups 2022-04-25 12:24:40 -05:00
sophia
ea87b6824d
Upgrade bolt to bbolt
boltdb/bolt is no longer a maintained project. bbolt is the CoreOS
fork that the author of boltdb suggests using as a replacement.
2022-04-25 12:24:34 -05:00
sophia
058d929046
Setup data.db in global vagrant data path 2022-04-25 12:24:33 -05:00
Chris Roberts
07dbd15ea6
Attach functions to client instead of basis 2022-04-25 12:24:24 -05:00
Chris Roberts
05d5634c83
Host component related work 2022-04-25 12:24:10 -05:00
Chris Roberts
3f86194f60
Replace machine usage with target. Update proto ref location to plugin sdk 2022-04-25 12:24:06 -05:00
Chris Roberts
741ab97565
Remove core machine and environment services 2022-04-25 12:24:06 -05:00
Chris Roberts
bba557c29d
Close the client to shutdown the plugin and prevent hang.
This also updates the Ruby runtime usage to pass the ClientProtocol
    instead of the full client since after init we only need it for
    dispensing plugins.
2022-04-25 12:23:59 -05:00
Chris Roberts
cffd771288
Move Vagrant runtime out of server and into runner (via client startup) 2022-04-25 12:23:58 -05:00
sophia
c3ee750db1
Add gogo 2022-04-25 12:23:57 -05:00