Add reva-gateway endpoint to service discovery

Reva can't be wrapped as a go-micro service due to private apis. We workaround byy manually registering the address and port in the service-registry.
This commit is contained in:
Ilja Neumann
2020-04-09 19:38:48 +02:00
committed by Ilja Neumann
parent 78ead1a5d8
commit ca4e13e462
5 changed files with 141 additions and 28 deletions
+14
View File
@@ -14,6 +14,7 @@ import (
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis-reva/pkg/server/debug"
"github.com/owncloud/ocis-reva/pkg/service/external"
)
// Gateway is the entrypoint for the gateway command.
@@ -145,6 +146,18 @@ func Gateway(cfg *config.Config) *cli.Command {
}
gr.Add(func() error {
err := external.RegisterGRPCEndpoint(
ctx,
"com.owncloud.reva",
uuid.String(),
cfg.Reva.Gateway.Addr,
logger,
)
if err != nil {
return err
}
runtime.Run(rcfg, pidFile)
return nil
}, func(_ error) {
@@ -154,6 +167,7 @@ func Gateway(cfg *config.Config) *cli.Command {
cancel()
})
}
{