From 1f4b16542c2efc379e6c3c55137f522509d36929 Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Fri, 20 Sep 2024 15:34:52 +0800 Subject: [PATCH] feat(v2/salvage): identify engine instance created to salvage longhorn/longhorn-8430 Signed-off-by: Chin-Ya Huang --- pkg/client/instance.go | 2 ++ pkg/instance/instance.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/client/instance.go b/pkg/client/instance.go index 6b4f67083..c2f862385 100644 --- a/pkg/client/instance.go +++ b/pkg/client/instance.go @@ -91,6 +91,7 @@ type EngineCreateRequest struct { InitiatorAddress string TargetAddress string UpgradeRequired bool + SalvageRequested bool } type ReplicaCreateRequest struct { @@ -147,6 +148,7 @@ func (c *InstanceServiceClient) InstanceCreate(req *InstanceCreateRequest) (*api Size: req.Size, ReplicaAddressMap: req.Engine.ReplicaAddressMap, Frontend: req.Engine.Frontend, + SalvageRequested: req.Engine.SalvageRequested, } case types.InstanceTypeReplica: spdkInstanceSpec = &rpc.SpdkInstanceSpec{ diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index a22d65647..a534ed39c 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -151,7 +151,7 @@ func (ops V2DataEngineInstanceOps) InstanceCreate(req *rpc.InstanceCreateRequest switch req.Spec.Type { case types.InstanceTypeEngine: engine, err := c.EngineCreate(req.Spec.Name, req.Spec.VolumeName, req.Spec.SpdkInstanceSpec.Frontend, req.Spec.SpdkInstanceSpec.Size, req.Spec.SpdkInstanceSpec.ReplicaAddressMap, - req.Spec.PortCount, req.Spec.InitiatorAddress, req.Spec.TargetAddress, req.Spec.UpgradeRequired) + req.Spec.PortCount, req.Spec.InitiatorAddress, req.Spec.TargetAddress, req.Spec.UpgradeRequired, req.Spec.SpdkInstanceSpec.SalvageRequested) if err != nil { return nil, err }