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.
28 lines
594 B
Ruby
28 lines
594 B
Ruby
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
|