-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor database plugin SDK #29479
refactor database plugin SDK #29479
Conversation
CI Results: |
Build Results: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just had a minor comment about file naming for the CE components that are more than a "typical stub" but it could be a moot point
|
||
type entGRPCClient struct{} | ||
|
||
func (c gRPCClient) Close() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm does Close()
really count as a "stub" even if it performs real functionality (i.e. not just a no-op)? Not sure what the naming convention should be (i.e. maybe just _oss
instead of _stubs_oss
for these?) but it seems different than the rest of the stubs I've seen so far
Had a similar thought for the rest of the _stubs_oss
files that are also moving existing CE functionality (but they do more than a typical no-op)
// GRPCClient (Vault CE edition) initializes and returns a gRPCClient with Database and | ||
// PluginVersion gRPC clients. It implements GRPCClient() defined | ||
// by GRPCPlugin interface in go-plugin/plugin.go | ||
func (GRPCDatabasePlugin) GRPCClient(doneCtx context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thought on _stubs_oss
to just _oss
for this file given GRPCClient and GRPCServer do much more than a typical no-op
|
||
// NewPluginClient returns a databaseRPCClient with a connection to a running | ||
// plugin. | ||
func NewPluginClient(ctx context.Context, sys pluginutil.RunnerUtil, config pluginutil.PluginClientConfig) (Database, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thought on _stubs_oss
to just _oss
for this file given NewPluginClient does much more than a typical no-op
Thanks! I've just learnt today that we also have |
Description
What does this PR do?
This PR refactors database plugin SDK and prepares for ENT database plugin SDK development.
Related ENT PR: https://github.com/hashicorp/vault-enterprise/pull/7347
Ticket: VAULT-33548
RFC: https://go.hashi.co/rfc/vlt-337
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.