diff --git a/services/webdav/pkg/command/server.go b/services/webdav/pkg/command/server.go index dcd4d99ce..9a2dcdb78 100644 --- a/services/webdav/pkg/command/server.go +++ b/services/webdav/pkg/command/server.go @@ -33,7 +33,7 @@ func Server(cfg *config.Config) *cli.Command { if err != nil { return err } - err = ogrpc.Configure(ogrpc.GetClientOptions(cfg.GRPCClientTLS)...) + cfg.GrpcClient, err = ogrpc.NewClient(ogrpc.GetClientOptions(cfg.GRPCClientTLS)...) if err != nil { return err } diff --git a/services/webdav/pkg/config/config.go b/services/webdav/pkg/config/config.go index 3edbb56fe..7b2c88778 100644 --- a/services/webdav/pkg/config/config.go +++ b/services/webdav/pkg/config/config.go @@ -4,6 +4,7 @@ import ( "context" "github.com/owncloud/ocis/v2/ocis-pkg/shared" + "go-micro.dev/v4/client" ) // Config combines all available configuration parts. @@ -17,6 +18,7 @@ type Config struct { Debug Debug `yaml:"debug"` GRPCClientTLS *shared.GRPCClientTLS `yaml:"grpc_client_tls"` + GrpcClient client.Client `yaml:"-"` HTTP HTTP `yaml:"http"` diff --git a/services/webdav/pkg/service/v0/service.go b/services/webdav/pkg/service/v0/service.go index f60b75a62..3d5f0d03b 100644 --- a/services/webdav/pkg/service/v0/service.go +++ b/services/webdav/pkg/service/v0/service.go @@ -19,7 +19,6 @@ import ( "github.com/go-chi/render" "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" thumbnailsmsg "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/thumbnails/v0" searchsvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/search/v0" thumbnailssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/thumbnails/v0" @@ -77,8 +76,8 @@ func NewService(opts ...Option) (Service, error) { config: conf, log: options.Logger, mux: m, - searchClient: searchsvc.NewSearchProviderService("com.owncloud.api.search", grpc.DefaultClient()), - thumbnailsClient: thumbnailssvc.NewThumbnailService("com.owncloud.api.thumbnails", grpc.DefaultClient()), + searchClient: searchsvc.NewSearchProviderService("com.owncloud.api.search", conf.GrpcClient), + thumbnailsClient: thumbnailssvc.NewThumbnailService("com.owncloud.api.thumbnails", conf.GrpcClient), gatewaySelector: gatewaySelector, }