Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/control service object list #2933

Merged
merged 5 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changelog for NeoFS Node
- More effective FSTree writer for HDDs, new configuration options for it (#2814)
- New health status `INITIALIZING_NETWORK` in inner ring (#2934)
- Expose health status of inner ring via Prometheus (#2934)
- `neofs-cli control object list` command (#2853)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ dep:
protoc:
@GOPRIVATE=github.com/nspcc-dev go mod vendor
# Install specific version for protobuf lib
@go list -f '{{.Path}}/...@{{.Version}}' -m github.com/golang/protobuf | xargs go install -v
@go list -f '{{.Path}}/...@{{.Version}}' -m google.golang.org/protobuf | xargs go install -v
carpawell marked this conversation as resolved.
Show resolved Hide resolved
@GOBIN=$(abspath $(BIN)) go install -mod=mod -v github.com/nspcc-dev/neofs-api-go/v2/util/protogen
# Protoc generate
@for f in `find . -type f -name '*.proto' -not -path './vendor/*'`; do \
Expand Down
18 changes: 18 additions & 0 deletions cmd/neofs-cli/modules/control/object.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package control

import (
"github.com/spf13/cobra"
)

var objectCmd = &cobra.Command{
Use: "object",
Short: "Direct object operations with storage engine",
}

func initControlObjectsCmd() {
objectCmd.AddCommand(listObjectsCmd)
objectCmd.AddCommand(objectStatusCmd)

Check warning on line 14 in cmd/neofs-cli/modules/control/object.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/object.go#L12-L14

Added lines #L12 - L14 were not covered by tests

initControlObjectsListCmd()
initObjectStatusFlags()

Check warning on line 17 in cmd/neofs-cli/modules/control/object.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/object.go#L16-L17

Added lines #L16 - L17 were not covered by tests
}
47 changes: 47 additions & 0 deletions cmd/neofs-cli/modules/control/object_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package control

import (
rawclient "github.com/nspcc-dev/neofs-api-go/v2/rpc/client"
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/common"
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/commonflags"
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/key"
"github.com/nspcc-dev/neofs-node/pkg/services/control"
"github.com/spf13/cobra"
)

var listObjectsCmd = &cobra.Command{
Use: "list",
Short: "Get list of all objects in the storage node",
Long: "Get list of all objects in the storage node",
Args: cobra.NoArgs,
Run: listObjects,
carpawell marked this conversation as resolved.
Show resolved Hide resolved
}

func initControlObjectsListCmd() {
initControlFlags(listObjectsCmd)

Check warning on line 21 in cmd/neofs-cli/modules/control/object_list.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/object_list.go#L20-L21

Added lines #L20 - L21 were not covered by tests
}

func listObjects(cmd *cobra.Command, _ []string) {
ctx, cancel := commonflags.GetCommandContext(cmd)
defer cancel()

Check warning on line 26 in cmd/neofs-cli/modules/control/object_list.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/object_list.go#L24-L26

Added lines #L24 - L26 were not covered by tests

pk := key.Get(cmd)

Check warning on line 28 in cmd/neofs-cli/modules/control/object_list.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/object_list.go#L28

Added line #L28 was not covered by tests

req := &control.ListObjectsRequest{
Body: &control.ListObjectsRequest_Body{},

Check warning on line 31 in cmd/neofs-cli/modules/control/object_list.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/object_list.go#L30-L31

Added lines #L30 - L31 were not covered by tests
}
signRequest(cmd, pk, req)

Check warning on line 33 in cmd/neofs-cli/modules/control/object_list.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/object_list.go#L33

Added line #L33 was not covered by tests

cli := getClient(ctx, cmd)

Check warning on line 35 in cmd/neofs-cli/modules/control/object_list.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/object_list.go#L35

Added line #L35 was not covered by tests

err := cli.ExecRaw(func(client *rawclient.Client) error {
return control.ListObjects(client, req, func(r *control.ListObjectsResponse) {
verifyResponse(cmd, r.GetSignature(), r.GetBody())

Check warning on line 39 in cmd/neofs-cli/modules/control/object_list.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/object_list.go#L37-L39

Added lines #L37 - L39 were not covered by tests

for _, address := range r.GetBody().GetObjectAddress() {
cmd.Println(string(address))

Check warning on line 42 in cmd/neofs-cli/modules/control/object_list.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/object_list.go#L41-L42

Added lines #L41 - L42 were not covered by tests
}
})
})
common.ExitOnErr(cmd, "rpc error: %w", err)

Check warning on line 46 in cmd/neofs-cli/modules/control/object_list.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/object_list.go#L46

Added line #L46 was not covered by tests
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ import (

const objectFlag = "object"

var objectCmd = &cobra.Command{
Use: "object",
Short: "Direct object operations with storage engine",
}

var objectStatusCmd = &cobra.Command{
Use: "status",
Short: "Check current object status",
Expand Down
6 changes: 1 addition & 5 deletions cmd/neofs-cli/modules/control/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
)

func init() {
objectCmd.AddCommand(
objectStatusCmd,
)

Cmd.AddCommand(
healthCheckCmd,
setNetmapStatusCmd,
Expand All @@ -45,5 +41,5 @@
initControlDropObjectsCmd()
initControlShardsCmd()
initControlSynchronizeTreeCmd()
initObjectStatusFlags()
initControlObjectsCmd()

Check warning on line 44 in cmd/neofs-cli/modules/control/root.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/control/root.go#L44

Added line #L44 was not covered by tests
}
2 changes: 1 addition & 1 deletion cmd/neofs-cli/modules/tree/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
meta, err := parseMeta(cmd)
common.ExitOnErr(cmd, "meta data parsing: %w", err)

cli, err := _client(ctx)
cli, err := _client()

Check warning on line 53 in cmd/neofs-cli/modules/tree/add.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/tree/add.go#L53

Added line #L53 was not covered by tests
common.ExitOnErr(cmd, "client: %w", err)

rawCID := make([]byte, sha256.Size)
Expand Down
2 changes: 1 addition & 1 deletion cmd/neofs-cli/modules/tree/add_by_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

tid, _ := cmd.Flags().GetString(treeIDFlagKey)

cli, err := _client(ctx)
cli, err := _client()

Check warning on line 57 in cmd/neofs-cli/modules/tree/add_by_path.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/tree/add_by_path.go#L57

Added line #L57 was not covered by tests
common.ExitOnErr(cmd, "client: %w", err)

rawCID := make([]byte, sha256.Size)
Expand Down
14 changes: 3 additions & 11 deletions cmd/neofs-cli/modules/tree/client.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package tree

import (
"context"
"strings"
"time"

"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/commonflags"
"github.com/nspcc-dev/neofs-node/pkg/network"
Expand All @@ -15,26 +13,20 @@

// _client returns grpc Tree service client. Should be removed
// after making Tree API public.
func _client(ctx context.Context) (tree.TreeServiceClient, error) {
func _client() (tree.TreeServiceClient, error) {

Check warning on line 16 in cmd/neofs-cli/modules/tree/client.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/tree/client.go#L16

Added line #L16 was not covered by tests
var netAddr network.Address
err := netAddr.FromString(viper.GetString(commonflags.RPC))
if err != nil {
return nil, err
}

opts := make([]grpc.DialOption, 1, 2)
opts[0] = grpc.WithBlock()
opts := make([]grpc.DialOption, 0, 1)

Check warning on line 23 in cmd/neofs-cli/modules/tree/client.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/tree/client.go#L23

Added line #L23 was not covered by tests

if !strings.HasPrefix(netAddr.URIAddr(), "grpcs:") {
opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))
}

// a default connection establishing timeout
const defaultClientConnectTimeout = time.Second * 2

ctx, cancel := context.WithTimeout(ctx, defaultClientConnectTimeout)
cc, err := grpc.DialContext(ctx, netAddr.URIAddr(), opts...)
cancel()
cc, err := grpc.NewClient(netAddr.URIAddr(), opts...)

Check warning on line 29 in cmd/neofs-cli/modules/tree/client.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/tree/client.go#L29

Added line #L29 was not covered by tests

return tree.NewTreeServiceClient(cc), err
}
2 changes: 1 addition & 1 deletion cmd/neofs-cli/modules/tree/get_by_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

tid, _ := cmd.Flags().GetString(treeIDFlagKey)

cli, err := _client(ctx)
cli, err := _client()

Check warning on line 57 in cmd/neofs-cli/modules/tree/get_by_path.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/tree/get_by_path.go#L57

Added line #L57 was not covered by tests
common.ExitOnErr(cmd, "client: %w", err)

rawCID := make([]byte, sha256.Size)
Expand Down
2 changes: 1 addition & 1 deletion cmd/neofs-cli/modules/tree/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
err := cnr.DecodeString(cidString)
common.ExitOnErr(cmd, "decode container ID string: %w", err)

cli, err := _client(ctx)
cli, err := _client()

Check warning on line 45 in cmd/neofs-cli/modules/tree/list.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/tree/list.go#L45

Added line #L45 was not covered by tests
common.ExitOnErr(cmd, "client: %w", err)

rawCID := make([]byte, sha256.Size)
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ require (
golang.org/x/sync v0.6.0
golang.org/x/sys v0.18.0
golang.org/x/term v0.18.0
google.golang.org/grpc v1.62.0
google.golang.org/grpc v1.64.0
google.golang.org/protobuf v1.33.0
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -50,7 +50,6 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
Expand Down Expand Up @@ -95,7 +94,7 @@ require (
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
Expand Down
14 changes: 4 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,13 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
Expand Down Expand Up @@ -284,18 +280,16 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY=
google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk=
google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=
google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
19 changes: 19 additions & 0 deletions pkg/services/control/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,25 @@
return nil
}

type listObjectsResponseWrapper struct {
m *ListObjectsResponse
}

func (w *listObjectsResponseWrapper) ToGRPCMessage() grpc.Message {
return w.m

Check warning on line 100 in pkg/services/control/convert.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/control/convert.go#L99-L100

Added lines #L99 - L100 were not covered by tests
}

func (w *listObjectsResponseWrapper) FromGRPCMessage(m grpc.Message) error {
var ok bool

Check warning on line 104 in pkg/services/control/convert.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/control/convert.go#L103-L104

Added lines #L103 - L104 were not covered by tests

w.m, ok = m.(*ListObjectsResponse)
if !ok {
return message.NewUnexpectedMessageType(m, w.m)

Check warning on line 108 in pkg/services/control/convert.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/control/convert.go#L106-L108

Added lines #L106 - L108 were not covered by tests
}

return nil

Check warning on line 111 in pkg/services/control/convert.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/control/convert.go#L111

Added line #L111 was not covered by tests
}

type setShardModeResponseWrapper struct {
m *SetShardModeResponse
}
Expand Down
37 changes: 37 additions & 0 deletions pkg/services/control/rpc.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package control

import (
"errors"
"io"

"github.com/nspcc-dev/neofs-api-go/v2/rpc/client"
"github.com/nspcc-dev/neofs-api-go/v2/rpc/common"
)
Expand All @@ -12,6 +15,7 @@
rpcSetNetmapStatus = "SetNetmapStatus"
rpcDropObjects = "DropObjects"
rpcListShards = "ListShards"
rpcListObjects = "ListObjects"
rpcSetShardMode = "SetShardMode"
rpcDumpShard = "DumpShard"
rpcRestoreShard = "RestoreShard"
Expand Down Expand Up @@ -107,6 +111,39 @@
return wResp.m, nil
}

// ListObjects executes ControlService.ListObjects RPC.
func ListObjects(
cli *client.Client,
req *ListObjectsRequest,
handleResp func(*ListObjectsResponse),
opts ...client.CallOption,
) error {
wReq := &requestWrapper{
m: req,

Check warning on line 122 in pkg/services/control/rpc.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/control/rpc.go#L120-L122

Added lines #L120 - L122 were not covered by tests
}

stream, err := client.OpenServerStream(cli, common.CallMethodInfoServerStream(serviceName, rpcListObjects), wReq, opts...)
if err != nil {
return err

Check warning on line 127 in pkg/services/control/rpc.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/control/rpc.go#L125-L127

Added lines #L125 - L127 were not covered by tests
}

for {
wResp := &listObjectsResponseWrapper{
m: new(ListObjectsResponse),

Check warning on line 132 in pkg/services/control/rpc.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/control/rpc.go#L130-L132

Added lines #L130 - L132 were not covered by tests
}
err = stream.ReadMessage(wResp)
if errors.Is(err, io.EOF) {
break

Check warning on line 136 in pkg/services/control/rpc.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/control/rpc.go#L134-L136

Added lines #L134 - L136 were not covered by tests
}
if err != nil {
return err

Check warning on line 139 in pkg/services/control/rpc.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/control/rpc.go#L138-L139

Added lines #L138 - L139 were not covered by tests
}
handleResp(wResp.m)

Check warning on line 141 in pkg/services/control/rpc.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/control/rpc.go#L141

Added line #L141 was not covered by tests
}

return nil

Check warning on line 144 in pkg/services/control/rpc.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/control/rpc.go#L144

Added line #L144 was not covered by tests
}

// SetShardMode executes ControlService.SetShardMode RPC.
func SetShardMode(
cli *client.Client,
Expand Down
Loading
Loading