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.
This commit is contained in:
Paul Hinze 2022-01-11 18:00:18 -06:00
parent 3005f7e274
commit 0fef7cc416
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
25 changed files with 1780 additions and 1610 deletions

View File

@ -1,13 +1,12 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v3.13.0
// protoc-gen-go v1.26.0
// protoc v3.18.0
// source: vagrant-ruby/builtin/myplugin/proto/plugin.proto
package proto
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@ -21,10 +20,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type UpResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache

View File

@ -1,18 +1,17 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v3.13.0
// protoc-gen-go v1.26.0
// protoc v3.18.0
// source: proto/ruby_vagrant/ruby-server.proto
package ruby_vagrant
import (
proto "github.com/golang/protobuf/proto"
_ "github.com/golang/protobuf/ptypes/any"
empty "github.com/golang/protobuf/ptypes/empty"
vagrant_plugin_sdk "github.com/hashicorp/vagrant-plugin-sdk/proto/vagrant_plugin_sdk"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "google.golang.org/protobuf/types/known/anypb"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
)
@ -24,10 +23,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// Supported plugin types, the values here MUST match the enum values
// in the Go sdk/component package exactly. A test in internal/server
// validates this.
@ -48,6 +43,7 @@ const (
Plugin_MAPPER Plugin_Type = 11
Plugin_CONFIG Plugin_Type = 12
Plugin_PLUGININFO Plugin_Type = 13
Plugin_PUSH Plugin_Type = 14
)
// Enum value maps for Plugin_Type.
@ -67,6 +63,7 @@ var (
11: "MAPPER",
12: "CONFIG",
13: "PLUGININFO",
14: "PUSH",
}
Plugin_Type_value = map[string]int32{
"UNKNOWN": 0,
@ -83,6 +80,7 @@ var (
"MAPPER": 11,
"CONFIG": 12,
"PLUGININFO": 13,
"PUSH": 14,
}
)
@ -328,12 +326,12 @@ var file_proto_ruby_vagrant_ruby_server_proto_rawDesc = []byte{
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f,
0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69,
0x6e, 0x52, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x22, 0xa6, 0x02, 0x0a, 0x06, 0x50,
0x6e, 0x52, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x22, 0xb0, 0x02, 0x0a, 0x06, 0x50,
0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63,
0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x6c, 0x75, 0x67,
0x69, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xd3, 0x01,
0x69, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xdd, 0x01,
0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57,
0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x10, 0x01,
0x12, 0x10, 0x0a, 0x0c, 0x43, 0x4f, 0x4d, 0x4d, 0x55, 0x4e, 0x49, 0x43, 0x41, 0x54, 0x4f, 0x52,
@ -347,34 +345,34 @@ var file_proto_ruby_vagrant_ruby_server_proto_rawDesc = []byte{
0x4c, 0x4f, 0x47, 0x56, 0x49, 0x45, 0x57, 0x45, 0x52, 0x10, 0x0a, 0x12, 0x0a, 0x0a, 0x06, 0x4d,
0x41, 0x50, 0x50, 0x45, 0x52, 0x10, 0x0b, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4e, 0x46, 0x49,
0x47, 0x10, 0x0c, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x49, 0x4e, 0x46,
0x4f, 0x10, 0x0d, 0x22, 0x2d, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72,
0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12,
0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61,
0x74, 0x68, 0x22, 0x6c, 0x0a, 0x18, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61,
0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50,
0x0a, 0x0b, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e,
0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x56, 0x61, 0x67, 0x72,
0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66,
0x69, 0x6c, 0x65, 0x52, 0x0b, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65,
0x32, 0xc7, 0x01, 0x0a, 0x0b, 0x52, 0x75, 0x62, 0x79, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74,
0x12, 0x4b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x16,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x25, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f,
0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c,
0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a,
0x10, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c,
0x65, 0x12, 0x2a, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61,
0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61,
0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e,
0x4f, 0x10, 0x0d, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x55, 0x53, 0x48, 0x10, 0x0e, 0x22, 0x2d, 0x0a,
0x17, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x6c, 0x0a, 0x18,
0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0b, 0x76, 0x61, 0x67, 0x72,
0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e,
0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e,
0x74, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69,
0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f,
0x72, 0x70, 0x2f, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72,
0x6e, 0x61, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x72, 0x75, 0x62, 0x79, 0x5f, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c,
0x65, 0x2e, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0b, 0x76,
0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x32, 0xc7, 0x01, 0x0a, 0x0b, 0x52,
0x75, 0x62, 0x79, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x4b, 0x0a, 0x0a, 0x47, 0x65,
0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x1a, 0x25, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67,
0x72, 0x61, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x10, 0x50, 0x61, 0x72, 0x73, 0x65,
0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x2a, 0x2e, 0x68, 0x61,
0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e,
0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63,
0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x73,
0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x76, 0x61, 0x67,
0x72, 0x61, 0x6e, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x75, 0x62, 0x79, 0x5f,
0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -398,7 +396,7 @@ var file_proto_ruby_vagrant_ruby_server_proto_goTypes = []interface{}{
(*ParseVagrantfileRequest)(nil), // 3: hashicorp.vagrant.ParseVagrantfileRequest
(*ParseVagrantfileResponse)(nil), // 4: hashicorp.vagrant.ParseVagrantfileResponse
(*vagrant_plugin_sdk.Vagrantfile_Vagrantfile)(nil), // 5: hashicorp.vagrant.sdk.Vagrantfile.Vagrantfile
(*empty.Empty)(nil), // 6: google.protobuf.Empty
(*emptypb.Empty)(nil), // 6: google.protobuf.Empty
}
var file_proto_ruby_vagrant_ruby_server_proto_depIdxs = []int32{
2, // 0: hashicorp.vagrant.GetPluginsResponse.plugins:type_name -> hashicorp.vagrant.Plugin

View File

@ -49,6 +49,7 @@ message Plugin {
MAPPER = 11;
CONFIG = 12;
PLUGININFO = 13;
PUSH = 14;
}
}

View File

@ -4,10 +4,10 @@ package ruby_vagrant
import (
context "context"
empty "github.com/golang/protobuf/ptypes/empty"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
@ -20,7 +20,7 @@ const _ = grpc.SupportPackageIsVersion7
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type RubyVagrantClient interface {
// Gets available ruby plugins
GetPlugins(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetPluginsResponse, error)
GetPlugins(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPluginsResponse, error)
ParseVagrantfile(ctx context.Context, in *ParseVagrantfileRequest, opts ...grpc.CallOption) (*ParseVagrantfileResponse, error)
}
@ -32,7 +32,7 @@ func NewRubyVagrantClient(cc grpc.ClientConnInterface) RubyVagrantClient {
return &rubyVagrantClient{cc}
}
func (c *rubyVagrantClient) GetPlugins(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetPluginsResponse, error) {
func (c *rubyVagrantClient) GetPlugins(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPluginsResponse, error) {
out := new(GetPluginsResponse)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.RubyVagrant/GetPlugins", in, out, opts...)
if err != nil {
@ -55,7 +55,7 @@ func (c *rubyVagrantClient) ParseVagrantfile(ctx context.Context, in *ParseVagra
// for forward compatibility
type RubyVagrantServer interface {
// Gets available ruby plugins
GetPlugins(context.Context, *empty.Empty) (*GetPluginsResponse, error)
GetPlugins(context.Context, *emptypb.Empty) (*GetPluginsResponse, error)
ParseVagrantfile(context.Context, *ParseVagrantfileRequest) (*ParseVagrantfileResponse, error)
mustEmbedUnimplementedRubyVagrantServer()
}
@ -64,7 +64,7 @@ type RubyVagrantServer interface {
type UnimplementedRubyVagrantServer struct {
}
func (UnimplementedRubyVagrantServer) GetPlugins(context.Context, *empty.Empty) (*GetPluginsResponse, error) {
func (UnimplementedRubyVagrantServer) GetPlugins(context.Context, *emptypb.Empty) (*GetPluginsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPlugins not implemented")
}
func (UnimplementedRubyVagrantServer) ParseVagrantfile(context.Context, *ParseVagrantfileRequest) (*ParseVagrantfileResponse, error) {
@ -84,7 +84,7 @@ func RegisterRubyVagrantServer(s grpc.ServiceRegistrar, srv RubyVagrantServer) {
}
func _RubyVagrant_GetPlugins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
@ -96,7 +96,7 @@ func _RubyVagrant_GetPlugins_Handler(srv interface{}, ctx context.Context, dec f
FullMethod: "/hashicorp.vagrant.RubyVagrant/GetPlugins",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RubyVagrantServer).GetPlugins(ctx, req.(*empty.Empty))
return srv.(RubyVagrantServer).GetPlugins(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}

File diff suppressed because it is too large Load Diff

View File

@ -482,6 +482,7 @@ message Component {
MAPPER = 11;
CONFIG = 12;
PLUGININFO = 13;
PUSH = 14;
}
}

View File

@ -4,10 +4,10 @@ package vagrant_server
import (
context "context"
empty "github.com/golang/protobuf/ptypes/empty"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
@ -22,11 +22,11 @@ type VagrantClient interface {
// GetVersionInfo returns information about the server. This RPC call does
// NOT require authentication. It can be used by clients to determine if they
// are capable of talking to this server.
GetVersionInfo(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetVersionInfoResponse, error)
GetVersionInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetVersionInfoResponse, error)
UpsertBasis(ctx context.Context, in *UpsertBasisRequest, opts ...grpc.CallOption) (*UpsertBasisResponse, error)
GetBasis(ctx context.Context, in *GetBasisRequest, opts ...grpc.CallOption) (*GetBasisResponse, error)
FindBasis(ctx context.Context, in *FindBasisRequest, opts ...grpc.CallOption) (*FindBasisResponse, error)
ListBasis(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListBasisResponse, error)
ListBasis(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListBasisResponse, error)
// ListTasks returns the tasks.
ListTasks(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error)
// GetTask returns a task
@ -44,19 +44,19 @@ type VagrantClient interface {
// ListProjects returns a list of all the projects. There is no equivalent
// ListApplications because applications are a part of projects and you
// can use GetProject to get more information about the project.
ListProjects(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListProjectsResponse, error)
ListProjects(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListProjectsResponse, error)
// UpsertTarget upserts a target with a project. If the target
// is already registered this does nothing.
UpsertTarget(ctx context.Context, in *UpsertTargetRequest, opts ...grpc.CallOption) (*UpsertTargetResponse, error)
DeleteTarget(ctx context.Context, in *DeleteTargetRequest, opts ...grpc.CallOption) (*empty.Empty, error)
DeleteTarget(ctx context.Context, in *DeleteTargetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
GetTarget(ctx context.Context, in *GetTargetRequest, opts ...grpc.CallOption) (*GetTargetResponse, error)
FindTarget(ctx context.Context, in *FindTargetRequest, opts ...grpc.CallOption) (*FindTargetResponse, error)
ListTargets(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListTargetsResponse, error)
ListTargets(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListTargetsResponse, error)
// CRUD operations for box
UpsertBox(ctx context.Context, in *UpsertBoxRequest, opts ...grpc.CallOption) (*UpsertBoxResponse, error)
DeleteBox(ctx context.Context, in *DeleteBoxRequest, opts ...grpc.CallOption) (*empty.Empty, error)
DeleteBox(ctx context.Context, in *DeleteBoxRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
GetBox(ctx context.Context, in *GetBoxRequest, opts ...grpc.CallOption) (*GetBoxResponse, error)
ListBoxes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListBoxesResponse, error)
ListBoxes(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListBoxesResponse, error)
FindBox(ctx context.Context, in *FindBoxRequest, opts ...grpc.CallOption) (*FindBoxResponse, error)
// GetLogStream reads the log stream for a deployment. This will immediately
// send a single LogEntry with the lines we have so far. If there are no
@ -79,7 +79,7 @@ type VagrantClient interface {
//
// This RPC always returns immediately. You must use GetJob or GetJobStream
// to wait on the status of the cancellation.
CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*empty.Empty, error)
CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// GetJob queries a job by ID.
GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*Job, error)
// INTERNAL: ListJobs lists all the jobs the server has processed. This
@ -94,15 +94,15 @@ type VagrantClient interface {
// Multiple listeners can open a job stream.
GetJobStream(ctx context.Context, in *GetJobStreamRequest, opts ...grpc.CallOption) (Vagrant_GetJobStreamClient, error)
// Clean out old jobs from the job database
PruneOldJobs(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error)
PruneOldJobs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
// GetRunner gets information about a single runner.
GetRunner(ctx context.Context, in *GetRunnerRequest, opts ...grpc.CallOption) (*Runner, error)
// GetServerConfig sets configuration for the Vagrant server.
GetServerConfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetServerConfigResponse, error)
GetServerConfig(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetServerConfigResponse, error)
// SetServerConfig sets configuration for the Vagrant server.
SetServerConfig(ctx context.Context, in *SetServerConfigRequest, opts ...grpc.CallOption) (*empty.Empty, error)
SetServerConfig(ctx context.Context, in *SetServerConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// CreateSnapshot creates a new database snapshot.
CreateSnapshot(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (Vagrant_CreateSnapshotClient, error)
CreateSnapshot(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Vagrant_CreateSnapshotClient, error)
// RestoreSnapshot performs a database restore with the given snapshot.
// This API doesn't do a full online restore, it only stages the restore
// for the next server start to finalize the restore. See the arguments for
@ -111,11 +111,11 @@ type VagrantClient interface {
// BootstrapToken returns the initial token for the server. This can only
// be requested once on first startup. After initial request this will
// always return a PermissionDenied error.
BootstrapToken(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*NewTokenResponse, error)
BootstrapToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NewTokenResponse, error)
// Generate a new invite token that users can exchange for a login token.
GenerateInviteToken(ctx context.Context, in *InviteTokenRequest, opts ...grpc.CallOption) (*NewTokenResponse, error)
// Generate a new login token that users can use to login directly.
GenerateLoginToken(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*NewTokenResponse, error)
GenerateLoginToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NewTokenResponse, error)
// Exchange a invite token for a login token.
ConvertInviteToken(ctx context.Context, in *ConvertInviteTokenRequest, opts ...grpc.CallOption) (*NewTokenResponse, error)
// RunnerConfig is called to register a runner and receive the configuration
@ -135,7 +135,7 @@ func NewVagrantClient(cc grpc.ClientConnInterface) VagrantClient {
return &vagrantClient{cc}
}
func (c *vagrantClient) GetVersionInfo(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetVersionInfoResponse, error) {
func (c *vagrantClient) GetVersionInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetVersionInfoResponse, error) {
out := new(GetVersionInfoResponse)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/GetVersionInfo", in, out, opts...)
if err != nil {
@ -171,7 +171,7 @@ func (c *vagrantClient) FindBasis(ctx context.Context, in *FindBasisRequest, opt
return out, nil
}
func (c *vagrantClient) ListBasis(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListBasisResponse, error) {
func (c *vagrantClient) ListBasis(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListBasisResponse, error) {
out := new(ListBasisResponse)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/ListBasis", in, out, opts...)
if err != nil {
@ -243,7 +243,7 @@ func (c *vagrantClient) FindProject(ctx context.Context, in *FindProjectRequest,
return out, nil
}
func (c *vagrantClient) ListProjects(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListProjectsResponse, error) {
func (c *vagrantClient) ListProjects(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListProjectsResponse, error) {
out := new(ListProjectsResponse)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/ListProjects", in, out, opts...)
if err != nil {
@ -261,8 +261,8 @@ func (c *vagrantClient) UpsertTarget(ctx context.Context, in *UpsertTargetReques
return out, nil
}
func (c *vagrantClient) DeleteTarget(ctx context.Context, in *DeleteTargetRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
func (c *vagrantClient) DeleteTarget(ctx context.Context, in *DeleteTargetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/DeleteTarget", in, out, opts...)
if err != nil {
return nil, err
@ -288,7 +288,7 @@ func (c *vagrantClient) FindTarget(ctx context.Context, in *FindTargetRequest, o
return out, nil
}
func (c *vagrantClient) ListTargets(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListTargetsResponse, error) {
func (c *vagrantClient) ListTargets(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListTargetsResponse, error) {
out := new(ListTargetsResponse)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/ListTargets", in, out, opts...)
if err != nil {
@ -306,8 +306,8 @@ func (c *vagrantClient) UpsertBox(ctx context.Context, in *UpsertBoxRequest, opt
return out, nil
}
func (c *vagrantClient) DeleteBox(ctx context.Context, in *DeleteBoxRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
func (c *vagrantClient) DeleteBox(ctx context.Context, in *DeleteBoxRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/DeleteBox", in, out, opts...)
if err != nil {
return nil, err
@ -324,7 +324,7 @@ func (c *vagrantClient) GetBox(ctx context.Context, in *GetBoxRequest, opts ...g
return out, nil
}
func (c *vagrantClient) ListBoxes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListBoxesResponse, error) {
func (c *vagrantClient) ListBoxes(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListBoxesResponse, error) {
out := new(ListBoxesResponse)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/ListBoxes", in, out, opts...)
if err != nil {
@ -401,8 +401,8 @@ func (c *vagrantClient) QueueJob(ctx context.Context, in *QueueJobRequest, opts
return out, nil
}
func (c *vagrantClient) CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
func (c *vagrantClient) CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/CancelJob", in, out, opts...)
if err != nil {
return nil, err
@ -469,8 +469,8 @@ func (x *vagrantGetJobStreamClient) Recv() (*GetJobStreamResponse, error) {
return m, nil
}
func (c *vagrantClient) PruneOldJobs(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
func (c *vagrantClient) PruneOldJobs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/PruneOldJobs", in, out, opts...)
if err != nil {
return nil, err
@ -487,7 +487,7 @@ func (c *vagrantClient) GetRunner(ctx context.Context, in *GetRunnerRequest, opt
return out, nil
}
func (c *vagrantClient) GetServerConfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetServerConfigResponse, error) {
func (c *vagrantClient) GetServerConfig(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetServerConfigResponse, error) {
out := new(GetServerConfigResponse)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/GetServerConfig", in, out, opts...)
if err != nil {
@ -496,8 +496,8 @@ func (c *vagrantClient) GetServerConfig(ctx context.Context, in *empty.Empty, op
return out, nil
}
func (c *vagrantClient) SetServerConfig(ctx context.Context, in *SetServerConfigRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
func (c *vagrantClient) SetServerConfig(ctx context.Context, in *SetServerConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/SetServerConfig", in, out, opts...)
if err != nil {
return nil, err
@ -505,7 +505,7 @@ func (c *vagrantClient) SetServerConfig(ctx context.Context, in *SetServerConfig
return out, nil
}
func (c *vagrantClient) CreateSnapshot(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (Vagrant_CreateSnapshotClient, error) {
func (c *vagrantClient) CreateSnapshot(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Vagrant_CreateSnapshotClient, error) {
stream, err := c.cc.NewStream(ctx, &Vagrant_ServiceDesc.Streams[2], "/hashicorp.vagrant.Vagrant/CreateSnapshot", opts...)
if err != nil {
return nil, err
@ -548,7 +548,7 @@ func (c *vagrantClient) RestoreSnapshot(ctx context.Context, opts ...grpc.CallOp
type Vagrant_RestoreSnapshotClient interface {
Send(*RestoreSnapshotRequest) error
CloseAndRecv() (*empty.Empty, error)
CloseAndRecv() (*emptypb.Empty, error)
grpc.ClientStream
}
@ -560,18 +560,18 @@ func (x *vagrantRestoreSnapshotClient) Send(m *RestoreSnapshotRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *vagrantRestoreSnapshotClient) CloseAndRecv() (*empty.Empty, error) {
func (x *vagrantRestoreSnapshotClient) CloseAndRecv() (*emptypb.Empty, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(empty.Empty)
m := new(emptypb.Empty)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *vagrantClient) BootstrapToken(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*NewTokenResponse, error) {
func (c *vagrantClient) BootstrapToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NewTokenResponse, error) {
out := new(NewTokenResponse)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/BootstrapToken", in, out, opts...)
if err != nil {
@ -589,7 +589,7 @@ func (c *vagrantClient) GenerateInviteToken(ctx context.Context, in *InviteToken
return out, nil
}
func (c *vagrantClient) GenerateLoginToken(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*NewTokenResponse, error) {
func (c *vagrantClient) GenerateLoginToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NewTokenResponse, error) {
out := new(NewTokenResponse)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.Vagrant/GenerateLoginToken", in, out, opts...)
if err != nil {
@ -676,11 +676,11 @@ type VagrantServer interface {
// GetVersionInfo returns information about the server. This RPC call does
// NOT require authentication. It can be used by clients to determine if they
// are capable of talking to this server.
GetVersionInfo(context.Context, *empty.Empty) (*GetVersionInfoResponse, error)
GetVersionInfo(context.Context, *emptypb.Empty) (*GetVersionInfoResponse, error)
UpsertBasis(context.Context, *UpsertBasisRequest) (*UpsertBasisResponse, error)
GetBasis(context.Context, *GetBasisRequest) (*GetBasisResponse, error)
FindBasis(context.Context, *FindBasisRequest) (*FindBasisResponse, error)
ListBasis(context.Context, *empty.Empty) (*ListBasisResponse, error)
ListBasis(context.Context, *emptypb.Empty) (*ListBasisResponse, error)
// ListTasks returns the tasks.
ListTasks(context.Context, *ListTasksRequest) (*ListTasksResponse, error)
// GetTask returns a task
@ -698,19 +698,19 @@ type VagrantServer interface {
// ListProjects returns a list of all the projects. There is no equivalent
// ListApplications because applications are a part of projects and you
// can use GetProject to get more information about the project.
ListProjects(context.Context, *empty.Empty) (*ListProjectsResponse, error)
ListProjects(context.Context, *emptypb.Empty) (*ListProjectsResponse, error)
// UpsertTarget upserts a target with a project. If the target
// is already registered this does nothing.
UpsertTarget(context.Context, *UpsertTargetRequest) (*UpsertTargetResponse, error)
DeleteTarget(context.Context, *DeleteTargetRequest) (*empty.Empty, error)
DeleteTarget(context.Context, *DeleteTargetRequest) (*emptypb.Empty, error)
GetTarget(context.Context, *GetTargetRequest) (*GetTargetResponse, error)
FindTarget(context.Context, *FindTargetRequest) (*FindTargetResponse, error)
ListTargets(context.Context, *empty.Empty) (*ListTargetsResponse, error)
ListTargets(context.Context, *emptypb.Empty) (*ListTargetsResponse, error)
// CRUD operations for box
UpsertBox(context.Context, *UpsertBoxRequest) (*UpsertBoxResponse, error)
DeleteBox(context.Context, *DeleteBoxRequest) (*empty.Empty, error)
DeleteBox(context.Context, *DeleteBoxRequest) (*emptypb.Empty, error)
GetBox(context.Context, *GetBoxRequest) (*GetBoxResponse, error)
ListBoxes(context.Context, *empty.Empty) (*ListBoxesResponse, error)
ListBoxes(context.Context, *emptypb.Empty) (*ListBoxesResponse, error)
FindBox(context.Context, *FindBoxRequest) (*FindBoxResponse, error)
// GetLogStream reads the log stream for a deployment. This will immediately
// send a single LogEntry with the lines we have so far. If there are no
@ -733,7 +733,7 @@ type VagrantServer interface {
//
// This RPC always returns immediately. You must use GetJob or GetJobStream
// to wait on the status of the cancellation.
CancelJob(context.Context, *CancelJobRequest) (*empty.Empty, error)
CancelJob(context.Context, *CancelJobRequest) (*emptypb.Empty, error)
// GetJob queries a job by ID.
GetJob(context.Context, *GetJobRequest) (*Job, error)
// INTERNAL: ListJobs lists all the jobs the server has processed. This
@ -748,15 +748,15 @@ type VagrantServer interface {
// Multiple listeners can open a job stream.
GetJobStream(*GetJobStreamRequest, Vagrant_GetJobStreamServer) error
// Clean out old jobs from the job database
PruneOldJobs(context.Context, *empty.Empty) (*empty.Empty, error)
PruneOldJobs(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
// GetRunner gets information about a single runner.
GetRunner(context.Context, *GetRunnerRequest) (*Runner, error)
// GetServerConfig sets configuration for the Vagrant server.
GetServerConfig(context.Context, *empty.Empty) (*GetServerConfigResponse, error)
GetServerConfig(context.Context, *emptypb.Empty) (*GetServerConfigResponse, error)
// SetServerConfig sets configuration for the Vagrant server.
SetServerConfig(context.Context, *SetServerConfigRequest) (*empty.Empty, error)
SetServerConfig(context.Context, *SetServerConfigRequest) (*emptypb.Empty, error)
// CreateSnapshot creates a new database snapshot.
CreateSnapshot(*empty.Empty, Vagrant_CreateSnapshotServer) error
CreateSnapshot(*emptypb.Empty, Vagrant_CreateSnapshotServer) error
// RestoreSnapshot performs a database restore with the given snapshot.
// This API doesn't do a full online restore, it only stages the restore
// for the next server start to finalize the restore. See the arguments for
@ -765,11 +765,11 @@ type VagrantServer interface {
// BootstrapToken returns the initial token for the server. This can only
// be requested once on first startup. After initial request this will
// always return a PermissionDenied error.
BootstrapToken(context.Context, *empty.Empty) (*NewTokenResponse, error)
BootstrapToken(context.Context, *emptypb.Empty) (*NewTokenResponse, error)
// Generate a new invite token that users can exchange for a login token.
GenerateInviteToken(context.Context, *InviteTokenRequest) (*NewTokenResponse, error)
// Generate a new login token that users can use to login directly.
GenerateLoginToken(context.Context, *empty.Empty) (*NewTokenResponse, error)
GenerateLoginToken(context.Context, *emptypb.Empty) (*NewTokenResponse, error)
// Exchange a invite token for a login token.
ConvertInviteToken(context.Context, *ConvertInviteTokenRequest) (*NewTokenResponse, error)
// RunnerConfig is called to register a runner and receive the configuration
@ -785,7 +785,7 @@ type VagrantServer interface {
type UnimplementedVagrantServer struct {
}
func (UnimplementedVagrantServer) GetVersionInfo(context.Context, *empty.Empty) (*GetVersionInfoResponse, error) {
func (UnimplementedVagrantServer) GetVersionInfo(context.Context, *emptypb.Empty) (*GetVersionInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetVersionInfo not implemented")
}
func (UnimplementedVagrantServer) UpsertBasis(context.Context, *UpsertBasisRequest) (*UpsertBasisResponse, error) {
@ -797,7 +797,7 @@ func (UnimplementedVagrantServer) GetBasis(context.Context, *GetBasisRequest) (*
func (UnimplementedVagrantServer) FindBasis(context.Context, *FindBasisRequest) (*FindBasisResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindBasis not implemented")
}
func (UnimplementedVagrantServer) ListBasis(context.Context, *empty.Empty) (*ListBasisResponse, error) {
func (UnimplementedVagrantServer) ListBasis(context.Context, *emptypb.Empty) (*ListBasisResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListBasis not implemented")
}
func (UnimplementedVagrantServer) ListTasks(context.Context, *ListTasksRequest) (*ListTasksResponse, error) {
@ -821,13 +821,13 @@ func (UnimplementedVagrantServer) GetProject(context.Context, *GetProjectRequest
func (UnimplementedVagrantServer) FindProject(context.Context, *FindProjectRequest) (*FindProjectResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindProject not implemented")
}
func (UnimplementedVagrantServer) ListProjects(context.Context, *empty.Empty) (*ListProjectsResponse, error) {
func (UnimplementedVagrantServer) ListProjects(context.Context, *emptypb.Empty) (*ListProjectsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListProjects not implemented")
}
func (UnimplementedVagrantServer) UpsertTarget(context.Context, *UpsertTargetRequest) (*UpsertTargetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpsertTarget not implemented")
}
func (UnimplementedVagrantServer) DeleteTarget(context.Context, *DeleteTargetRequest) (*empty.Empty, error) {
func (UnimplementedVagrantServer) DeleteTarget(context.Context, *DeleteTargetRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteTarget not implemented")
}
func (UnimplementedVagrantServer) GetTarget(context.Context, *GetTargetRequest) (*GetTargetResponse, error) {
@ -836,19 +836,19 @@ func (UnimplementedVagrantServer) GetTarget(context.Context, *GetTargetRequest)
func (UnimplementedVagrantServer) FindTarget(context.Context, *FindTargetRequest) (*FindTargetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindTarget not implemented")
}
func (UnimplementedVagrantServer) ListTargets(context.Context, *empty.Empty) (*ListTargetsResponse, error) {
func (UnimplementedVagrantServer) ListTargets(context.Context, *emptypb.Empty) (*ListTargetsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListTargets not implemented")
}
func (UnimplementedVagrantServer) UpsertBox(context.Context, *UpsertBoxRequest) (*UpsertBoxResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpsertBox not implemented")
}
func (UnimplementedVagrantServer) DeleteBox(context.Context, *DeleteBoxRequest) (*empty.Empty, error) {
func (UnimplementedVagrantServer) DeleteBox(context.Context, *DeleteBoxRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteBox not implemented")
}
func (UnimplementedVagrantServer) GetBox(context.Context, *GetBoxRequest) (*GetBoxResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBox not implemented")
}
func (UnimplementedVagrantServer) ListBoxes(context.Context, *empty.Empty) (*ListBoxesResponse, error) {
func (UnimplementedVagrantServer) ListBoxes(context.Context, *emptypb.Empty) (*ListBoxesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListBoxes not implemented")
}
func (UnimplementedVagrantServer) FindBox(context.Context, *FindBoxRequest) (*FindBoxResponse, error) {
@ -866,7 +866,7 @@ func (UnimplementedVagrantServer) GetConfig(context.Context, *ConfigGetRequest)
func (UnimplementedVagrantServer) QueueJob(context.Context, *QueueJobRequest) (*QueueJobResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueueJob not implemented")
}
func (UnimplementedVagrantServer) CancelJob(context.Context, *CancelJobRequest) (*empty.Empty, error) {
func (UnimplementedVagrantServer) CancelJob(context.Context, *CancelJobRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CancelJob not implemented")
}
func (UnimplementedVagrantServer) GetJob(context.Context, *GetJobRequest) (*Job, error) {
@ -881,31 +881,31 @@ func (UnimplementedVagrantServer) ValidateJob(context.Context, *ValidateJobReque
func (UnimplementedVagrantServer) GetJobStream(*GetJobStreamRequest, Vagrant_GetJobStreamServer) error {
return status.Errorf(codes.Unimplemented, "method GetJobStream not implemented")
}
func (UnimplementedVagrantServer) PruneOldJobs(context.Context, *empty.Empty) (*empty.Empty, error) {
func (UnimplementedVagrantServer) PruneOldJobs(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method PruneOldJobs not implemented")
}
func (UnimplementedVagrantServer) GetRunner(context.Context, *GetRunnerRequest) (*Runner, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRunner not implemented")
}
func (UnimplementedVagrantServer) GetServerConfig(context.Context, *empty.Empty) (*GetServerConfigResponse, error) {
func (UnimplementedVagrantServer) GetServerConfig(context.Context, *emptypb.Empty) (*GetServerConfigResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetServerConfig not implemented")
}
func (UnimplementedVagrantServer) SetServerConfig(context.Context, *SetServerConfigRequest) (*empty.Empty, error) {
func (UnimplementedVagrantServer) SetServerConfig(context.Context, *SetServerConfigRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetServerConfig not implemented")
}
func (UnimplementedVagrantServer) CreateSnapshot(*empty.Empty, Vagrant_CreateSnapshotServer) error {
func (UnimplementedVagrantServer) CreateSnapshot(*emptypb.Empty, Vagrant_CreateSnapshotServer) error {
return status.Errorf(codes.Unimplemented, "method CreateSnapshot not implemented")
}
func (UnimplementedVagrantServer) RestoreSnapshot(Vagrant_RestoreSnapshotServer) error {
return status.Errorf(codes.Unimplemented, "method RestoreSnapshot not implemented")
}
func (UnimplementedVagrantServer) BootstrapToken(context.Context, *empty.Empty) (*NewTokenResponse, error) {
func (UnimplementedVagrantServer) BootstrapToken(context.Context, *emptypb.Empty) (*NewTokenResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BootstrapToken not implemented")
}
func (UnimplementedVagrantServer) GenerateInviteToken(context.Context, *InviteTokenRequest) (*NewTokenResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GenerateInviteToken not implemented")
}
func (UnimplementedVagrantServer) GenerateLoginToken(context.Context, *empty.Empty) (*NewTokenResponse, error) {
func (UnimplementedVagrantServer) GenerateLoginToken(context.Context, *emptypb.Empty) (*NewTokenResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GenerateLoginToken not implemented")
}
func (UnimplementedVagrantServer) ConvertInviteToken(context.Context, *ConvertInviteTokenRequest) (*NewTokenResponse, error) {
@ -930,7 +930,7 @@ func RegisterVagrantServer(s grpc.ServiceRegistrar, srv VagrantServer) {
}
func _Vagrant_GetVersionInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
@ -942,7 +942,7 @@ func _Vagrant_GetVersionInfo_Handler(srv interface{}, ctx context.Context, dec f
FullMethod: "/hashicorp.vagrant.Vagrant/GetVersionInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VagrantServer).GetVersionInfo(ctx, req.(*empty.Empty))
return srv.(VagrantServer).GetVersionInfo(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
@ -1002,7 +1002,7 @@ func _Vagrant_FindBasis_Handler(srv interface{}, ctx context.Context, dec func(i
}
func _Vagrant_ListBasis_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
@ -1014,7 +1014,7 @@ func _Vagrant_ListBasis_Handler(srv interface{}, ctx context.Context, dec func(i
FullMethod: "/hashicorp.vagrant.Vagrant/ListBasis",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VagrantServer).ListBasis(ctx, req.(*empty.Empty))
return srv.(VagrantServer).ListBasis(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
@ -1146,7 +1146,7 @@ func _Vagrant_FindProject_Handler(srv interface{}, ctx context.Context, dec func
}
func _Vagrant_ListProjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
@ -1158,7 +1158,7 @@ func _Vagrant_ListProjects_Handler(srv interface{}, ctx context.Context, dec fun
FullMethod: "/hashicorp.vagrant.Vagrant/ListProjects",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VagrantServer).ListProjects(ctx, req.(*empty.Empty))
return srv.(VagrantServer).ListProjects(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
@ -1236,7 +1236,7 @@ func _Vagrant_FindTarget_Handler(srv interface{}, ctx context.Context, dec func(
}
func _Vagrant_ListTargets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
@ -1248,7 +1248,7 @@ func _Vagrant_ListTargets_Handler(srv interface{}, ctx context.Context, dec func
FullMethod: "/hashicorp.vagrant.Vagrant/ListTargets",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VagrantServer).ListTargets(ctx, req.(*empty.Empty))
return srv.(VagrantServer).ListTargets(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
@ -1308,7 +1308,7 @@ func _Vagrant_GetBox_Handler(srv interface{}, ctx context.Context, dec func(inte
}
func _Vagrant_ListBoxes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
@ -1320,7 +1320,7 @@ func _Vagrant_ListBoxes_Handler(srv interface{}, ctx context.Context, dec func(i
FullMethod: "/hashicorp.vagrant.Vagrant/ListBoxes",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VagrantServer).ListBoxes(ctx, req.(*empty.Empty))
return srv.(VagrantServer).ListBoxes(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
@ -1512,7 +1512,7 @@ func (x *vagrantGetJobStreamServer) Send(m *GetJobStreamResponse) error {
}
func _Vagrant_PruneOldJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
@ -1524,7 +1524,7 @@ func _Vagrant_PruneOldJobs_Handler(srv interface{}, ctx context.Context, dec fun
FullMethod: "/hashicorp.vagrant.Vagrant/PruneOldJobs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VagrantServer).PruneOldJobs(ctx, req.(*empty.Empty))
return srv.(VagrantServer).PruneOldJobs(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
@ -1548,7 +1548,7 @@ func _Vagrant_GetRunner_Handler(srv interface{}, ctx context.Context, dec func(i
}
func _Vagrant_GetServerConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
@ -1560,7 +1560,7 @@ func _Vagrant_GetServerConfig_Handler(srv interface{}, ctx context.Context, dec
FullMethod: "/hashicorp.vagrant.Vagrant/GetServerConfig",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VagrantServer).GetServerConfig(ctx, req.(*empty.Empty))
return srv.(VagrantServer).GetServerConfig(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
@ -1584,7 +1584,7 @@ func _Vagrant_SetServerConfig_Handler(srv interface{}, ctx context.Context, dec
}
func _Vagrant_CreateSnapshot_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(empty.Empty)
m := new(emptypb.Empty)
if err := stream.RecvMsg(m); err != nil {
return err
}
@ -1609,7 +1609,7 @@ func _Vagrant_RestoreSnapshot_Handler(srv interface{}, stream grpc.ServerStream)
}
type Vagrant_RestoreSnapshotServer interface {
SendAndClose(*empty.Empty) error
SendAndClose(*emptypb.Empty) error
Recv() (*RestoreSnapshotRequest, error)
grpc.ServerStream
}
@ -1618,7 +1618,7 @@ type vagrantRestoreSnapshotServer struct {
grpc.ServerStream
}
func (x *vagrantRestoreSnapshotServer) SendAndClose(m *empty.Empty) error {
func (x *vagrantRestoreSnapshotServer) SendAndClose(m *emptypb.Empty) error {
return x.ServerStream.SendMsg(m)
}
@ -1631,7 +1631,7 @@ func (x *vagrantRestoreSnapshotServer) Recv() (*RestoreSnapshotRequest, error) {
}
func _Vagrant_BootstrapToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
@ -1643,7 +1643,7 @@ func _Vagrant_BootstrapToken_Handler(srv interface{}, ctx context.Context, dec f
FullMethod: "/hashicorp.vagrant.Vagrant/BootstrapToken",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VagrantServer).BootstrapToken(ctx, req.(*empty.Empty))
return srv.(VagrantServer).BootstrapToken(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
@ -1667,7 +1667,7 @@ func _Vagrant_GenerateInviteToken_Handler(srv interface{}, ctx context.Context,
}
func _Vagrant_GenerateLoginToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
@ -1679,7 +1679,7 @@ func _Vagrant_GenerateLoginToken_Handler(srv interface{}, ctx context.Context, d
FullMethod: "/hashicorp.vagrant.Vagrant/GenerateLoginToken",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VagrantServer).GenerateLoginToken(ctx, req.(*empty.Empty))
return srv.(VagrantServer).GenerateLoginToken(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}

View File

@ -657,8 +657,15 @@ module Vagrant
# This executes the push with the given name, raising any exceptions that
# occur.
#
# @param name [String] Push plugin name
# @param manager [Vagrant::Plugin::Manager] Plugin Manager to use,
# defaults to the primary one registered but parameterized so it can be
# overridden in server mode
#
# @see VagrantPlugins::CommandServe::Service::PushService Server mode behavior
#
# Precondition: the push is not nil and exists.
def push(name)
def push(name, manager: Vagrant.plugin("2").manager)
@logger.info("Getting push: #{name}")
name = name.to_sym
@ -671,7 +678,7 @@ module Vagrant
end
strategy, config = pushes[name]
push_registry = Vagrant.plugin("2").manager.pushes
push_registry = manager.pushes
klass, _ = push_registry.get(strategy)
if klass.nil?
raise Vagrant::Errors::PushStrategyNotLoaded,

View File

@ -6,6 +6,7 @@ module Vagrant
autoload :Communicator, "vagrant/plugin/remote/communicator"
autoload :Manager, "vagrant/plugin/remote/manager"
autoload :Plugin, "vagrant/plugin/remote/plugin"
autoload :Push, "vagrant/plugin/remote/push"
autoload :SyncedFolder, "vagrant/plugin/remote/synced_folder"
end
end

View File

@ -193,20 +193,20 @@ module Vagrant
# end
# end
# def pushes
# return real_manager.synced_folders if plugin_manager.nil?
def pushes
return real_manager.pushes if plugin_manager.nil?
# Registry.new.tap do |result|
# plugin_manager.list_plugins(:push).each do |plg|
# sf_class = Class.new(V2::Push, &WRAPPER_CLASS)
# sf_class.plugin_name = plg[:name]
# sf_class.type = plg[:type]
# result.register(plg[:name].to_sym) do
# proc{sf_class}
# end
# end
# end
# end
Registry.new.tap do |result|
plugin_manager.list_plugins(:push).each do |plg|
sf_class = Class.new(V2::Push, &WRAPPER_CLASS)
sf_class.plugin_name = plg[:name]
sf_class.type = plg[:type]
result.register(plg[:name].to_sym) do
sf_class
end
end
end
end
end
end
end

View File

@ -0,0 +1,27 @@
module Vagrant
module Plugin
module Remote
class Push
# This module enables Push for server mode
module Remote
# Add an attribute accesor for the client
# when applied to the Push class
def self.prepended(klass)
klass.class_eval do
attr_accessor :client
end
end
def initialize(env, config, **opts)
@client = opts[:client]
super(env, config)
end
def push
client.push
end
end
end
end
end
end

View File

@ -30,6 +30,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
value :MAPPER, 11
value :CONFIG, 12
value :PLUGININFO, 13
value :PUSH, 14
end
add_message "hashicorp.vagrant.ParseVagrantfileRequest" do
optional :path, :string, 1

View File

@ -154,6 +154,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :network, :string, 2
optional :target, :string, 3
end
add_message "hashicorp.vagrant.sdk.Args.Push" do
optional :stream_id, :uint32, 1
optional :network, :string, 2
optional :target, :string, 3
end
add_message "hashicorp.vagrant.sdk.Args.SyncedFolder" do
optional :stream_id, :uint32, 1
optional :network, :string, 2
@ -832,6 +837,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :version, :string, 2
repeated :providers, :string, 3
end
add_message "hashicorp.vagrant.sdk.Push" do
end
add_message "hashicorp.vagrant.sdk.Push.PushResponse" do
optional :exit_code, :int32, 1
end
end
end
@ -869,6 +879,7 @@ module Hashicorp
Args::Host = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Args.Host").msgclass
Args::Guest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Args.Guest").msgclass
Args::Communicator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Args.Communicator").msgclass
Args::Push = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Args.Push").msgclass
Args::SyncedFolder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Args.SyncedFolder").msgclass
Args::TargetIndex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Args.TargetIndex").msgclass
Args::NamedCapability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Args.NamedCapability").msgclass
@ -1036,6 +1047,8 @@ module Hashicorp
BoxCollection::AllResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.BoxCollection.AllResponse").msgclass
BoxCollection::CleanRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.BoxCollection.CleanRequest").msgclass
BoxCollection::FindRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.BoxCollection.FindRequest").msgclass
Push = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Push").msgclass
Push::PushResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Push.PushResponse").msgclass
end
end
end

View File

@ -554,6 +554,23 @@ module Hashicorp
rpc :Find, ::Hashicorp::Vagrant::Sdk::BoxCollection::FindRequest, ::Hashicorp::Vagrant::Sdk::Args::Box
end
Stub = Service.rpc_stub_class
end
module PushService
class Service
include ::GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
self.service_name = 'hashicorp.vagrant.sdk.PushService'
rpc :PushSpec, ::Google::Protobuf::Empty, ::Hashicorp::Vagrant::Sdk::FuncSpec
rpc :Push, ::Hashicorp::Vagrant::Sdk::FuncSpec::Args, ::Hashicorp::Vagrant::Sdk::Push::PushResponse
rpc :Seed, ::Hashicorp::Vagrant::Sdk::Args::Seeds, ::Google::Protobuf::Empty
rpc :Seeds, ::Google::Protobuf::Empty, ::Hashicorp::Vagrant::Sdk::Args::Seeds
end
Stub = Service.rpc_stub_class
end
end

View File

@ -141,6 +141,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
value :MAPPER, 11
value :CONFIG, 12
value :PLUGININFO, 13
value :PUSH, 14
end
add_message "hashicorp.vagrant.Status" do
optional :state, :enum, 1, "hashicorp.vagrant.Status.State"

View File

@ -269,6 +269,7 @@ module Vagrant
->{ Vagrant::MachineIndex::Entry.extend(Vagrant::MachineIndex::Entry::Remote::ClassMethods) },
->{ Vagrant::Plugin::V2::SyncedFolder.prepend(Vagrant::Plugin::Remote::SyncedFolder::Remote) },
->{ Vagrant::Plugin::V2::Communicator.prepend(Vagrant::Plugin::Remote::Communicator::Remote) },
->{ Vagrant::Plugin::V2::Push.prepend(Vagrant::Plugin::Remote::Push::Remote) },
->{ Vagrant::Action::Builtin::MixinSyncedFolders.prepend(Vagrant::Action::Builtin::Remote::MixinSyncedFolders) },
].freeze
end

View File

@ -12,6 +12,7 @@ module VagrantPlugins
autoload :TargetIndex, Vagrant.source_root.join("plugins/commands/serve/client/target_index").to_s
autoload :PluginManager, Vagrant.source_root.join("plugins/commands/serve/client/plugin_manager").to_s
autoload :Project, Vagrant.source_root.join("plugins/commands/serve/client/project").to_s
autoload :Push, Vagrant.source_root.join("plugins/commands/serve/client/push").to_s
autoload :Target, Vagrant.source_root.join("plugins/commands/serve/client/target").to_s
autoload :Terminal, Vagrant.source_root.join("plugins/commands/serve/client/terminal").to_s
autoload :StateBag, Vagrant.source_root.join("plugins/commands/serve/client/state_bag").to_s

View File

@ -0,0 +1,20 @@
module VagrantPlugins
module CommandServe
module Client
class Push
prepend Util::ClientSetup
prepend Util::HasLogger
include Util::HasSeeds::Client
def push
logger.debug("doing push")
req = SDK::FuncSpec::Args.new(args: seed_protos)
res = client.push(req)
logger.debug("got response #{res}")
res
end
end
end
end
end

View File

@ -98,7 +98,7 @@ module VagrantPlugins
[Service::InternalService, Service::ProviderService, Service::GuestService,
Service::HostService, Service::CommandService, Service::SyncedFolderService,
Service::CommunicatorService,
Service::CommunicatorService, Service::PushService,
Broker::Streamer].each do |service_klass|
service = service_klass.new(broker: broker)
s.handle(service)

View File

@ -9,6 +9,7 @@ module VagrantPlugins
SDK::Args::Array => Array,
SDK::Args::Direct => Type::Direct,
SDK::Args::Guest => Client::Guest,
SDK::Args::Hash => Hash,
SDK::Args::Host => Client::Host,
SDK::Args::NamedCapability => Symbol,
@ -291,6 +292,7 @@ require Vagrant.source_root.join("plugins/commands/serve/mappers/machine.rb").to
require Vagrant.source_root.join("plugins/commands/serve/mappers/pathname.rb").to_s
require Vagrant.source_root.join("plugins/commands/serve/mappers/plugin_manager.rb").to_s
require Vagrant.source_root.join("plugins/commands/serve/mappers/project.rb").to_s
require Vagrant.source_root.join("plugins/commands/serve/mappers/push.rb").to_s
require Vagrant.source_root.join("plugins/commands/serve/mappers/state_bag.rb").to_s
require Vagrant.source_root.join("plugins/commands/serve/mappers/synced_folder.rb").to_s
require Vagrant.source_root.join("plugins/commands/serve/mappers/target.rb").to_s

View File

@ -0,0 +1,20 @@
module VagrantPlugins
module CommandServe
class Mappers
# Build a guest client from a proto instance
class PushFromProto < Mapper
def initialize
inputs = [].tap do |i|
i << Input.new(type: SDK::Args::Push)
i << Input.new(type: Broker)
end
super(inputs: inputs, output: Client::Push, func: method(:converter))
end
def converter(proto, broker)
Client::Push.load(proto, broker: broker)
end
end
end
end
end

View File

@ -11,6 +11,7 @@ module VagrantPlugins
autoload :InternalService, Vagrant.source_root.join("plugins/commands/serve/service/internal_service").to_s
autoload :ProviderService, Vagrant.source_root.join("plugins/commands/serve/service/provider_service").to_s
autoload :SyncedFolderService, Vagrant.source_root.join("plugins/commands/serve/service/synced_folder_service").to_s
autoload :PushService, Vagrant.source_root.join("plugins/commands/serve/service/push_service").to_s
class ServiceInfo < OpenStruct
class << self

View File

@ -23,6 +23,7 @@ module VagrantPlugins
[:hosts, :HOST],
[:providers, :PROVIDER],
[:provisioners, :PROVISIONER],
[:pushes, :PUSH],
[:synced_folders, :SYNCEDFOLDER]].map do |method, const|
plugin_manager.send(method).map do |k, v|
Hashicorp::Vagrant::Plugin.new(name: k, type: Hashicorp::Vagrant::Plugin::Type.const_get(const))

View File

@ -0,0 +1,53 @@
module VagrantPlugins
module CommandServe
module Service
class PushService < Hashicorp::Vagrant::Sdk::PushService::Service
prepend Util::HasMapper
prepend Util::HasBroker
prepend Util::HasLogger
include Util::ServiceInfo
include Util::HasSeeds::Service
include Util::ExceptionTransformer
def push(req, ctx)
with_info(ctx, broker: broker) do |info|
plugin_name = info.plugin_name
env = mapper.funcspec_map(req, expect: [Vagrant::Environment])
# Here we are reusing logic from Environment#push, which does the
# work of looking up the right plugin and scoping down the relevant
# config from the vagrantfile
#
# We are already in a remote lookup loop, so we pass in the local
# manager to ensure that the local plugin is being looked up.
result = env.push(plugin_name, manager: Vagrant.plugin("2").local_manager)
SDK::Push::PushResponse.new(
exit_code: result.respond_to?(:exit_code) ? result.exit_code : 0
)
end
end
def push_spec(*_)
SDK::FuncSpec.new(
name: "push_spec",
args: [
SDK::FuncSpec::Value.new(
type: "hashicorp.vagrant.sdk.Args.Project",
name: "",
),
],
result: [
SDK::FuncSpec::Value.new(
type: "hashicorp.vagrant.sdk.Push.PushResponse",
name: "",
),
],
)
end
end
end
end
end

View File

@ -57,6 +57,15 @@ module VagrantPlugins
end
config.finalize!
# It's important that we call _finalize! here also, because pushes get
# plucked out of the config in Environment#push without the larger
# root.finalize! walk having been done. This means that push configs
# were coming out unfinalized, which can cause havoc when they're
# passed through functions that attempt to capture keyword arguments,
# as they'll cause ruby to call .to_hash on the config, get a
# DummyConfig, and then blow up. That havoc was happening in server
# mode, and this call fixes it.
config._finalize!
# Store it for retrieval later
@__compiled_pushes[name] = [strategy, config]