Skip to content

Commit

Permalink
Remove duplicate import package
Browse files Browse the repository at this point in the history
Longhorn 4427

Signed-off-by: Derek Su <derek.su@suse.com>
(cherry picked from commit 5b141bd)
  • Loading branch information
derekbit authored and innobead committed Mar 6, 2023
1 parent 7d03a16 commit aa8fce3
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 93 deletions.
20 changes: 0 additions & 20 deletions pkg/proxy/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
48 changes: 0 additions & 48 deletions pkg/proxy/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
21 changes: 0 additions & 21 deletions pkg/proxy/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 0 additions & 4 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aa8fce3

Please sign in to comment.