Skip to content

Commit

Permalink
fix: populate pluginregistry at init time
Browse files Browse the repository at this point in the history
Signed-off-by: Jimil Desai <jimildesai42@gmail.com>
  • Loading branch information
jimil749 committed Jul 7, 2021
1 parent 4a90de1 commit c3afa96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions internal/grpc/services/userprovider/userprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
"github.com/cs3org/reva/pkg/errtypes"
"github.com/cs3org/reva/pkg/plugin"
"github.com/cs3org/reva/pkg/pluginregistry"
"github.com/cs3org/reva/pkg/rgrpc"
"github.com/cs3org/reva/pkg/rgrpc/status"
"github.com/cs3org/reva/pkg/sharedconf"
Expand Down Expand Up @@ -95,8 +94,6 @@ func getDriverPlugin(c *config) (user.Manager, error) {
func getDriver(c *config, plugin bool) (user.Manager, error) {
// if plugin flag is set, we fetch the driver from the plugin package via hashicorp go-plugin system
if plugin {
// populate the plugin registry
pluginregistry.Register("userprovider", &user.ProviderPlugin{})
mgr, err := getDriverPlugin(c)
if err != nil {
return nil, err
Expand Down
5 changes: 5 additions & 0 deletions pkg/user/rpc_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ import (
"net/rpc"

userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
"github.com/cs3org/reva/pkg/pluginregistry"
"github.com/hashicorp/go-plugin"
)

func init() {
pluginregistry.Register("userprovider", &ProviderPlugin{})
}

// ProviderPlugin is the implemenation of plugin.Plugin so we can serve/consume this.
type ProviderPlugin struct {
Impl Manager
Expand Down

0 comments on commit c3afa96

Please sign in to comment.