From 479e2769617e9f1936548ba424fc6e01a9de86f1 Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Fri, 27 Sep 2024 13:16:59 +0800 Subject: [PATCH] feat(v2/salvage): get snapshots from runtime replicas longhorn/longhorn-8430 Signed-off-by: Chin-Ya Huang --- pkg/instance/instance.go | 2 +- pkg/proxy/replica.go | 4 ++-- pkg/proxy/snapshot.go | 2 +- pkg/proxy/volume.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index 3ffd93ab1..0ce9d63d9 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -270,7 +270,7 @@ func (ops V2DataEngineInstanceOps) InstanceGet(req *rpc.InstanceGetRequest) (*rp switch req.Type { case types.InstanceTypeEngine: - engine, err := c.EngineGet(req.Name) + engine, err := c.EngineGet(req.Name, false) if err != nil { return nil, err } diff --git a/pkg/proxy/replica.go b/pkg/proxy/replica.go index b78618554..449cb7e84 100644 --- a/pkg/proxy/replica.go +++ b/pkg/proxy/replica.go @@ -151,7 +151,7 @@ func (ops V2DataEngineProxyOps) ReplicaList(ctx context.Context, req *rpc.ProxyE } defer c.Close() - recv, err := c.EngineGet(req.EngineName) + recv, err := c.EngineGet(req.EngineName, false) if err != nil { return nil, grpcstatus.Error(grpccodes.Internal, errors.Wrapf(err, "failed to get engine %v", req.EngineName).Error()) } @@ -228,7 +228,7 @@ func (ops V2DataEngineProxyOps) ReplicaRebuildingStatus(ctx context.Context, req } defer engineCli.Close() - e, err := engineCli.EngineGet(req.EngineName) + e, err := engineCli.EngineGet(req.EngineName, false) if err != nil { return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get engine %v: %v", req.EngineName, err) } diff --git a/pkg/proxy/snapshot.go b/pkg/proxy/snapshot.go index 35dcb356e..4748e9e11 100644 --- a/pkg/proxy/snapshot.go +++ b/pkg/proxy/snapshot.go @@ -135,7 +135,7 @@ func (ops V2DataEngineProxyOps) SnapshotList(ctx context.Context, req *rpc.Proxy } defer c.Close() - engine, err := c.EngineGet(req.EngineName) + engine, err := c.EngineGet(req.EngineName, true) if err != nil { return nil, errors.Wrapf(err, "failed to get engine %v", req.EngineName) } diff --git a/pkg/proxy/volume.go b/pkg/proxy/volume.go index aa1637ab7..45a58be99 100644 --- a/pkg/proxy/volume.go +++ b/pkg/proxy/volume.go @@ -71,7 +71,7 @@ func (ops V2DataEngineProxyOps) VolumeGet(ctx context.Context, req *rpc.ProxyEng } defer c.Close() - recv, err := c.EngineGet(req.EngineName) + recv, err := c.EngineGet(req.EngineName, false) if err != nil { return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get engine %v: %v", req.EngineName, err) }