422 Commits

Author SHA1 Message Date
sophia
891eb27e9a
Rename plugin "target" to "addr" 2022-04-25 12:26:27 -05:00
Chris Roberts
46a9440b57
Set remaining args into proto 2022-04-25 12:26:26 -05:00
Chris Roberts
204cedcd68
Add missing set docs 2022-04-25 12:26:26 -05:00
Chris Roberts
0e385a785c
Add flag validation when parsing 2022-04-25 12:26:25 -05:00
Chris Roberts
341daf8dea
Return group after creating 2022-04-25 12:26:25 -05:00
Chris Roberts
9d9430e60b
Add flag validation tests 2022-04-25 12:26:25 -05:00
Chris Roberts
7e60a11936
Add test coverage on group 2022-04-25 12:26:25 -05:00
Chris Roberts
dfee85ea5e
Add doc notes to group 2022-04-25 12:26:25 -05:00
Chris Roberts
08f9eaa603
Adjust display rules 2022-04-25 12:26:25 -05:00
Chris Roberts
ae9cee6229
Fix types on flag vars 2022-04-25 12:26:25 -05:00
Chris Roberts
c010ae0429
Update CLI to use internal flags implementation 2022-04-25 12:26:25 -05:00
Chris Roberts
05facc0035
Add flags library 2022-04-25 12:26:25 -05:00
Chris Roberts
16931138e7
Update git submodule location
Having the modules stored in `./vendor` causes issues with `go mod`.
    Follow waypoint's convention to store in `./thirdparty` and grab
    the same Makefile modifications to alert when the submodules need
    to be initialized. Update generators to use new path.
2022-04-25 12:26:25 -05:00
sophia
5fda271283
go generate . 2022-04-25 12:26:23 -05:00
sophia
896cdea21f
Delete machine from db 2022-04-25 12:26:23 -05:00
sophia
3dbd9286be
Merge targets with upserting 2022-04-25 12:26:23 -05:00
sophia
12de22a7db
Get machine state 2022-04-25 12:26:23 -05:00
sophia
8a39ee6960
Set target state in addition to machine state 2022-04-25 12:26:22 -05:00
sophia
5ed50277bd
Find target in index by uuid or name 2022-04-25 12:26:22 -05:00
Chris Roberts
d8145cdd52
Update flag value extraction for dynamic commands 2022-04-25 12:26:22 -05:00
Chris Roberts
e00f82fdee
Update to use component flags and update parsing 2022-04-25 12:26:22 -05:00
Chris Roberts
39439cf9fb
Register commands and subcommands during setup 2022-04-25 12:26:22 -05:00
Chris Roberts
66dc2fd259
Remove loading status during startup 2022-04-25 12:26:22 -05:00
Chris Roberts
5115bc3fb3
Update to use component command flags 2022-04-25 12:26:21 -05:00
Chris Roberts
3933632216
Update flag mappers to use generic component flag struct 2022-04-25 12:26:21 -05:00
Paul Hinze
92c345b42d
Allow go push plugins to use config from Vagrantfile
* Populate push configs when parsing the vagrantfile
* Allow untyped configs to be shipped over GRPC
* In our demo plugin, walk the vagrantfile and snag the config

Example Vagrantfile that works with the demo plugin:

```ruby
Vagrant.configure("2") do |config|
  config.push.define "myplugin" do |push|
    push.coolkey = "coolvalue"
    push.alist = ["so", "many", "items"]
    push.ahash = { "hashkey" => "hashvalue" }
  end
end

```
2022-04-25 12:26:21 -05:00
Paul Hinze
0fef7cc416
Port push plugins
This uses the new Push plugin support added to the plugin SDK in https://github.com/hashicorp/vagrant-plugin-sdk/pull/106 to make the following changes:

 * The plugin manager on the Go side now registers push plugins
 * The the _remote_ plugin manager on the Ruby side now calls over to
   the go side to get push plugins
 * All the wiring is hooked up such that when a push plugin is replaced
   with its remote GRPC-client-wielding equivalent, the messages are
   ferried around.
2022-04-25 12:26:21 -05:00
sophia
deb667ecd3
Use common rpc errdetails messages 2022-04-25 12:26:20 -05:00
sophia
219473fb60
Seach for localized error message in error details 2022-04-25 12:26:20 -05:00
sophia
c4e97bb89b
Send localized message originating from plugin (if applicable) 2022-04-25 12:26:20 -05:00
sophia
45e64b9890
Add localized message proto 2022-04-25 12:26:20 -05:00
sophia
aeda0ec039
Pass error status with job completion results 2022-04-25 12:26:20 -05:00
Chris Roberts
6b4e13c615
Use environment variable for logging level 2022-04-25 12:26:19 -05:00
Chris Roberts
42a89335d4
Set environment variable to persist logging level 2022-04-25 12:26:19 -05:00
Paul Hinze
ab5a7f2b27
Remove httpfs package
You want to know something silly? There are multiple versions of
go-bindata floating around in the world, and they have different
features and flags.

This httpfs package was written with
https://github.com/go-bindata/go-bindata and uses the -fs flag. Most
everyone else (nixpkgs, homebrew) seems to have moved over to this fork
https://github.com/kevinburke/go-bindata, which does not have that
feature.

Run `go generate` with this installed and you'll get an error like `flag
provided but not defined: -fs`.

It looks like `httpfs` is the odd one out here, and it's not used
anywhere I can find either here or waypoint, so let's just remove it so
we can `go generate` cleanly with the version of go-bindata that most
people are using.
2022-04-25 12:26:19 -05:00
Chris Roberts
72b8547cce
Generated proto updates 2022-04-25 12:26:15 -05:00
Chris Roberts
acb32d33f7
Get parent count directly from plugin 2022-04-25 12:26:14 -05:00
Chris Roberts
1155e7be21
Configure plugins and use plugin local functions 2022-04-25 12:26:14 -05:00
Chris Roberts
b2c02428ae
Close plugin manager when closing runner 2022-04-25 12:26:14 -05:00
Chris Roberts
9f320145ff
Add support for custom component configuration 2022-04-25 12:26:14 -05:00
Chris Roberts
20a3f4d85c
Provide core.PluginManager implementation and server setup 2022-04-25 12:26:14 -05:00
Chris Roberts
27d0fee45f
Define plugin interfaces in plugin. Load parent from plugin.
Also applies registered configurations from the plugin
    manager when providing a requested component type.
2022-04-25 12:26:14 -05:00
Chris Roberts
b2dec1191a
Remove interfaces and add extra info to instance 2022-04-25 12:26:14 -05:00
sophia
9ea254735a
Set target uuid opposed to resource id
The uuid is the public identifier vs the resource id which should
be for internal operations.
The target uuid should correspond to the machine id (given by
the provider)
2022-04-25 12:26:13 -05:00
sophia
63a4b76c21
Add tests for setting machine id 2022-04-25 12:26:13 -05:00
sophia
294293097c
Set empty machine id when destroying 2022-04-25 12:26:13 -05:00
Paul Hinze
2460961749
Switch to centralized VagrantCWD implementation
Now depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/104
2022-04-25 12:26:12 -05:00
Paul Hinze
9bda64f78d
Handle crossplatform path discrepancy in CWD test 2022-04-25 12:26:12 -05:00
Paul Hinze
30774c7345
Fix VAGRANT_CWD handling
VAGRANT_CWD was not being honored in the Go-side Vagrantfile-finding
code. Add that in and also fix a couple of bugs in the path walking
logic.
2022-04-25 12:26:12 -05:00
sophia
ea680d78f7
Seed synced folder plugins with machine 2022-04-25 12:26:12 -05:00