From 7ed84d17557f7e18ca7aed4629544b6ed97fb548 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 29 Mar 2022 15:49:39 +0300 Subject: [PATCH] [#1278] acl: Return netmap.Source interface Application can provide cached netmap source in this case. Signed-off-by: Alex Vanin --- cmd/neofs-node/object.go | 2 +- pkg/services/object/acl/v2/opts.go | 8 ++++---- pkg/services/object/acl/v2/service.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/neofs-node/object.go b/cmd/neofs-node/object.go index a054f3ea9..4ad933ae8 100644 --- a/cmd/neofs-node/object.go +++ b/cmd/neofs-node/object.go @@ -358,7 +358,7 @@ func initObjectService(c *cfg) { aclSvc := v2.New( v2.WithLogger(c.log), v2.WithIRFetcher(irFetcher), - v2.WithNetmapClient(c.cfgNetmap.wrapper), + v2.WithNetmapSource(c.cfgNetmap.wrapper), v2.WithContainerSource( c.cfgObject.cnrSource, ), diff --git a/pkg/services/object/acl/v2/opts.go b/pkg/services/object/acl/v2/opts.go index ec2f80242..40d14c596 100644 --- a/pkg/services/object/acl/v2/opts.go +++ b/pkg/services/object/acl/v2/opts.go @@ -2,7 +2,7 @@ package v2 import ( "github.com/nspcc-dev/neofs-node/pkg/core/container" - netmapClient "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap" + "github.com/nspcc-dev/neofs-node/pkg/core/netmap" objectSvc "github.com/nspcc-dev/neofs-node/pkg/services/object" "go.uber.org/zap" ) @@ -14,9 +14,9 @@ func WithLogger(v *zap.Logger) Option { } } -// WithNetmapClient return option to set -// netmap client. -func WithNetmapClient(v *netmapClient.Client) Option { +// WithNetmapSource return option to set +// netmap source. +func WithNetmapSource(v netmap.Source) Option { return func(c *cfg) { c.nm = v } diff --git a/pkg/services/object/acl/v2/service.go b/pkg/services/object/acl/v2/service.go index 254e77917..eb2511eaf 100644 --- a/pkg/services/object/acl/v2/service.go +++ b/pkg/services/object/acl/v2/service.go @@ -7,7 +7,7 @@ import ( objectV2 "github.com/nspcc-dev/neofs-api-go/v2/object" "github.com/nspcc-dev/neofs-node/pkg/core/container" - netmapClient "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap" + "github.com/nspcc-dev/neofs-node/pkg/core/netmap" "github.com/nspcc-dev/neofs-node/pkg/services/object" cidSDK "github.com/nspcc-dev/neofs-sdk-go/container/id" eaclSDK "github.com/nspcc-dev/neofs-sdk-go/eacl" @@ -63,7 +63,7 @@ type cfg struct { irFetcher InnerRingFetcher - nm *netmapClient.Client + nm netmap.Source next object.ServiceServer }