From aa8fce394ea1835274634055797449e86e39a8eb Mon Sep 17 00:00:00 2001 From: Derek Su Date: Sat, 10 Dec 2022 22:19:39 +0800 Subject: [PATCH] Remove duplicate import package Longhorn 4427 Signed-off-by: Derek Su (cherry picked from commit 5b141bdfb9244819a31edcc35d317ab453796669) --- pkg/proxy/replica.go | 20 ------------------ pkg/proxy/snapshot.go | 48 ------------------------------------------- pkg/proxy/volume.go | 21 ------------------- pkg/util/util.go | 4 ---- 4 files changed, 93 deletions(-) diff --git a/pkg/proxy/replica.go b/pkg/proxy/replica.go index 13afd3291..b468f6005 100644 --- a/pkg/proxy/replica.go +++ b/pkg/proxy/replica.go @@ -135,23 +135,3 @@ func (p *Proxy) ReplicaRemove(ctx context.Context, req *rpc.EngineReplicaRemoveR return &empty.Empty{}, nil } -<<<<<<< HEAD -======= - -func (p *Proxy) ReplicaModeUpdate(ctx context.Context, req *rpc.EngineReplicaModeUpdateRequest) (resp *empty.Empty, err error) { - log := logrus.WithFields(logrus.Fields{"serviceURL": req.ProxyEngineRequest.Address}) - log.Infof("Updating replica mode to %v", req.Mode) - - c, err := eclient.NewControllerClient(req.ProxyEngineRequest.Address) - if err != nil { - return nil, err - } - defer c.Close() - - if _, err = c.ReplicaUpdate(req.ReplicaAddress, eptypes.GRPCReplicaModeToReplicaMode(req.Mode)); err != nil { - return nil, err - } - - return &empty.Empty{}, nil -} ->>>>>>> 2b6f99d (Change some debug level message to info level) diff --git a/pkg/proxy/snapshot.go b/pkg/proxy/snapshot.go index 1380d8fb6..1ced2e5a3 100644 --- a/pkg/proxy/snapshot.go +++ b/pkg/proxy/snapshot.go @@ -210,51 +210,3 @@ func (p *Proxy) SnapshotRemove(ctx context.Context, req *rpc.EngineSnapshotRemov return &empty.Empty{}, lastErr } -<<<<<<< HEAD -======= - -func (p *Proxy) SnapshotHash(ctx context.Context, req *rpc.EngineSnapshotHashRequest) (resp *empty.Empty, err error) { - log := logrus.WithFields(logrus.Fields{"serviceURL": req.ProxyEngineRequest.Address}) - log.Infof("Hashing snapshot %v with rehash %v", req.SnapshotName, req.Rehash) - - task, err := esync.NewTask(ctx, req.ProxyEngineRequest.Address) - if err != nil { - return nil, err - } - - if err := task.HashSnapshot(req.SnapshotName, req.Rehash); err != nil { - return nil, err - } - - return &empty.Empty{}, nil -} - -func (p *Proxy) SnapshotHashStatus(ctx context.Context, req *rpc.EngineSnapshotHashStatusRequest) (resp *rpc.EngineSnapshotHashStatusProxyResponse, err error) { - log := logrus.WithFields(logrus.Fields{"serviceURL": req.ProxyEngineRequest.Address}) - log.Trace("Getting snapshot hash status") - - task, err := esync.NewTask(ctx, req.ProxyEngineRequest.Address) - if err != nil { - return nil, err - } - - recv, err := task.HashSnapshotStatus(req.SnapshotName) - if err != nil { - return nil, err - } - - resp = &rpc.EngineSnapshotHashStatusProxyResponse{ - Status: map[string]*eptypes.SnapshotHashStatusResponse{}, - } - for k, v := range recv { - resp.Status[k] = &eptypes.SnapshotHashStatusResponse{ - State: v.State, - Checksum: v.Checksum, - Error: v.Error, - SilentlyCorrupted: v.SilentlyCorrupted, - } - } - - return resp, nil -} ->>>>>>> 2b6f99d (Change some debug level message to info level) diff --git a/pkg/proxy/volume.go b/pkg/proxy/volume.go index 8c26369fd..23d2879da 100644 --- a/pkg/proxy/volume.go +++ b/pkg/proxy/volume.go @@ -94,24 +94,3 @@ func (p *Proxy) VolumeFrontendShutdown(ctx context.Context, req *rpc.ProxyEngine return &empty.Empty{}, nil } -<<<<<<< HEAD -======= - -func (p *Proxy) VolumeUnmapMarkSnapChainRemovedSet(ctx context.Context, req *rpc.EngineVolumeUnmapMarkSnapChainRemovedSetRequest) (resp *empty.Empty, err error) { - log := logrus.WithFields(logrus.Fields{"serviceURL": req.ProxyEngineRequest.Address}) - log.Infof("Setting volume flag UnmapMarkSnapChainRemoved to %v", req.UnmapMarkSnap.Enabled) - - c, err := eclient.NewControllerClient(req.ProxyEngineRequest.Address) - if err != nil { - return nil, err - } - defer c.Close() - - err = c.VolumeUnmapMarkSnapChainRemovedSet(req.UnmapMarkSnap.Enabled) - if err != nil { - return nil, err - } - - return &empty.Empty{}, nil -} ->>>>>>> 2b6f99d (Change some debug level message to info level) diff --git a/pkg/util/util.go b/pkg/util/util.go index 2e8fae8dd..36f2975be 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -80,11 +80,7 @@ func RemoveFile(file string) error { } if _, err := Execute("rm", file); err != nil { -<<<<<<< HEAD - return fmt.Errorf("fail to remove file %v: %v", file, err) -======= return errors.Wrapf(err, "failed to remove file %v", file) ->>>>>>> c1b8d3e (Unify the format of log messages) } return nil