mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 02:57:59 +00:00
Version protocol switch (#3833)
* Use version to determine plugin protocol to use * Remove field from ServeOpts * Fix missing assignment, handle errors * contraint -> constraint * Inject the version string from the vault side * Fix the version check * Add grpc support check to database plugins * Default to use grpc unless missing env var or fail on contraint check * Add GRPCSupport test * Add greater than test case * Add go-version dep
This commit is contained in:
committed by
GitHub
parent
4551b9250f
commit
c3c63313f3
@@ -47,8 +47,7 @@ func Serve(opts *ServeOpts) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// If FetchMetadata is true, run without TLSProvider
|
||||
plugin.Serve(&plugin.ServeConfig{
|
||||
serveOpts := &plugin.ServeConfig{
|
||||
HandshakeConfig: handshakeConfig,
|
||||
Plugins: pluginMap,
|
||||
TLSProvider: opts.TLSProviderFunc,
|
||||
@@ -56,7 +55,14 @@ func Serve(opts *ServeOpts) error {
|
||||
|
||||
// A non-nil value here enables gRPC serving for this plugin...
|
||||
GRPCServer: plugin.DefaultGRPCServer,
|
||||
})
|
||||
}
|
||||
|
||||
if !pluginutil.GRPCSupport() {
|
||||
serveOpts.GRPCServer = nil
|
||||
}
|
||||
|
||||
// If FetchMetadata is true, run without TLSProvider
|
||||
plugin.Serve(serveOpts)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user