[full-ci] enhancement: use reva client pool selectors (#6452)
* enhancement: use reva client pool selectors register mock service to registry and pass tests * enhancement: bump reva * Fix a couple of linter issues --------- Co-authored-by: Ralf Haferkamp <rhaferkamp@owncloud.com>
This commit is contained in:
co-authored by
Ralf Haferkamp
parent
021c9fcdd9
commit
4f26424db6
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/oklog/run"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/service/external"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/registry"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/sync"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/version"
|
||||
"github.com/owncloud/ocis/v2/services/sharing/pkg/config"
|
||||
@@ -55,12 +55,16 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
}
|
||||
}
|
||||
|
||||
pidFile := path.Join(os.TempDir(), "revad-"+cfg.Service.Name+"-"+uuid.Must(uuid.NewV4()).String()+".pid")
|
||||
|
||||
rcfg := revaconfig.SharingConfigFromStruct(cfg)
|
||||
|
||||
gr.Add(func() error {
|
||||
runtime.RunWithOptions(rcfg, pidFile, runtime.WithLogger(&logger.Logger))
|
||||
pidFile := path.Join(os.TempDir(), "revad-"+cfg.Service.Name+"-"+uuid.Must(uuid.NewV4()).String()+".pid")
|
||||
rCfg := revaconfig.SharingConfigFromStruct(cfg)
|
||||
reg := registry.GetRegistry()
|
||||
|
||||
runtime.RunWithOptions(rCfg, pidFile,
|
||||
runtime.WithLogger(&logger.Logger),
|
||||
runtime.WithRegistry(reg),
|
||||
)
|
||||
|
||||
return nil
|
||||
}, func(err error) {
|
||||
logger.Error().
|
||||
@@ -90,15 +94,9 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
sync.Trap(&gr, cancel)
|
||||
}
|
||||
|
||||
if err := external.RegisterGRPCEndpoint(
|
||||
ctx,
|
||||
cfg.GRPC.Namespace+"."+cfg.Service.Name,
|
||||
uuid.Must(uuid.NewV4()).String(),
|
||||
cfg.GRPC.Addr,
|
||||
version.GetString(),
|
||||
logger,
|
||||
); err != nil {
|
||||
logger.Fatal().Err(err).Msg("failed to register the grpc endpoint")
|
||||
grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, uuid.Must(uuid.NewV4()).String(), cfg.GRPC.Addr, version.GetString())
|
||||
if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil {
|
||||
logger.Fatal().Err(err).Msg("failed to register the grpc service")
|
||||
}
|
||||
|
||||
return gr.Run()
|
||||
|
||||
@@ -41,11 +41,11 @@ func DefaultConfig() *config.Config {
|
||||
File: filepath.Join(defaults.BaseDataPath(), "storage", "shares.json"),
|
||||
},
|
||||
CS3: config.UserSharingCS3Driver{
|
||||
ProviderAddr: "127.0.0.1:9215", // system storage
|
||||
ProviderAddr: "com.owncloud.api.storage-system",
|
||||
SystemUserIDP: "internal",
|
||||
},
|
||||
JSONCS3: config.UserSharingJSONCS3Driver{
|
||||
ProviderAddr: "127.0.0.1:9215", // system storage
|
||||
ProviderAddr: "com.owncloud.api.storage-system",
|
||||
SystemUserIDP: "internal",
|
||||
},
|
||||
OwnCloudSQL: config.UserSharingOwnCloudSQLDriver{
|
||||
@@ -61,11 +61,11 @@ func DefaultConfig() *config.Config {
|
||||
File: filepath.Join(defaults.BaseDataPath(), "storage", "publicshares.json"),
|
||||
},
|
||||
CS3: config.PublicSharingCS3Driver{
|
||||
ProviderAddr: "127.0.0.1:9215", // system storage
|
||||
ProviderAddr: "com.owncloud.api.storage-system", // system storage
|
||||
SystemUserIDP: "internal",
|
||||
},
|
||||
JSONCS3: config.PublicSharingJSONCS3Driver{
|
||||
ProviderAddr: "127.0.0.1:9215", // system storage
|
||||
ProviderAddr: "com.owncloud.api.storage-system", // system storage
|
||||
SystemUserIDP: "internal",
|
||||
},
|
||||
// TODO implement and add owncloudsql publicshare driver
|
||||
|
||||
Reference in New Issue
Block a user