diff --git a/controller/engine_controller.go b/controller/engine_controller.go index 9146f592bb..318cad2969 100644 --- a/controller/engine_controller.go +++ b/controller/engine_controller.go @@ -1565,8 +1565,8 @@ func cloneSnapshot(engine *longhorn.Engine, engineClientProxy engineapi.EngineCl } sourceEngineControllerURL := imutil.GetURL(sourceEngine.Status.StorageIP, sourceEngine.Status.Port) - if err := engineClientProxy.SnapshotClone(engine, snapshotName, sourceEngineControllerURL, sourceEngine.Name, - fileSyncHTTPClientTimeout); err != nil { + if err := engineClientProxy.SnapshotClone(engine, snapshotName, sourceEngineControllerURL, + sourceEngine.Spec.VolumeName, sourceEngine.Name, fileSyncHTTPClientTimeout); err != nil { // There is only 1 replica during volume cloning, // so if the cloning failed, it must be that the replica failed to clone. for _, status := range engine.Status.CloneStatus { diff --git a/engineapi/enginesim.go b/engineapi/enginesim.go index c108d009c4..8d672ac2e5 100644 --- a/engineapi/enginesim.go +++ b/engineapi/enginesim.go @@ -217,7 +217,7 @@ func (e *EngineSimulator) BackupRestore(engine *longhorn.Engine, backupTarget, b return fmt.Errorf(ErrNotImplement) } -func (e *EngineSimulator) SnapshotClone(engine *longhorn.Engine, snapshotName, fromEngineAddress, +func (e *EngineSimulator) SnapshotClone(engine *longhorn.Engine, snapshotName, fromEngineAddress, fromVolumeName, fromEngineName string, fileSyncHTTPClientTimeout int64) error { return fmt.Errorf(ErrNotImplement) } diff --git a/engineapi/proxy_snapshot.go b/engineapi/proxy_snapshot.go index 4d65e09283..917a59cf8e 100644 --- a/engineapi/proxy_snapshot.go +++ b/engineapi/proxy_snapshot.go @@ -32,10 +32,10 @@ func (p *Proxy) SnapshotGet(e *longhorn.Engine, name string) (snapshot *longhorn return recv[name], nil } -func (p *Proxy) SnapshotClone(e *longhorn.Engine, snapshotName, fromEngineAddress, fromEngineName string, +func (p *Proxy) SnapshotClone(e *longhorn.Engine, snapshotName, fromEngineAddress, fromVolumeName, fromEngineName string, fileSyncHTTPClientTimeout int64) (err error) { return p.grpcClient.SnapshotClone(string(e.Spec.BackendStoreDriver), e.Name, e.Spec.VolumeName, p.DirectToURL(e), - snapshotName, fromEngineAddress, fromEngineName, int(fileSyncHTTPClientTimeout)) + snapshotName, fromEngineAddress, fromVolumeName, fromEngineName, int(fileSyncHTTPClientTimeout)) } func (p *Proxy) SnapshotCloneStatus(e *longhorn.Engine) (status map[string]*longhorn.SnapshotCloneStatus, err error) { diff --git a/engineapi/snapshot.go b/engineapi/snapshot.go index dfe6467d94..d9f3fd9d9c 100644 --- a/engineapi/snapshot.go +++ b/engineapi/snapshot.go @@ -105,8 +105,8 @@ func (e *EngineBinary) SnapshotPurgeStatus(*longhorn.Engine) (map[string]*longho // SnapshotClone calls engine binary // TODO: Deprecated, replaced by gRPC proxy -func (e *EngineBinary) SnapshotClone(engine *longhorn.Engine, snapshotName, fromEngineAddress, fromEngineName string, - fileSyncHTTPClientTimeout int64) error { +func (e *EngineBinary) SnapshotClone(engine *longhorn.Engine, snapshotName, fromEngineAddress, fromVolumeName, + fromEngineName string, fileSyncHTTPClientTimeout int64) error { args := []string{"snapshot", "clone", "--snapshot-name", snapshotName, "--from-controller-address", fromEngineAddress} diff --git a/engineapi/types.go b/engineapi/types.go index df0c6c4cd7..f7518bdeed 100644 --- a/engineapi/types.go +++ b/engineapi/types.go @@ -96,7 +96,7 @@ type EngineClient interface { SnapshotBackup(engine *longhorn.Engine, backupName, snapName, backupTarget, backingImageName, backingImageChecksum, compressionMethod string, concurrentLimit int, storageClassName string, labels, credential map[string]string) (string, string, error) SnapshotBackupStatus(engine *longhorn.Engine, backupName, replicaAddress, replicaName string) (*longhorn.EngineBackupStatus, error) SnapshotCloneStatus(engine *longhorn.Engine) (map[string]*longhorn.SnapshotCloneStatus, error) - SnapshotClone(engine *longhorn.Engine, snapshotName, fromEngineAddress, fromEngineName string, fileSyncHTTPClientTimeout int64) error + SnapshotClone(engine *longhorn.Engine, snapshotName, fromEngineAddress, fromVolumeName, fromEngineName string, fileSyncHTTPClientTimeout int64) error SnapshotHash(engine *longhorn.Engine, snapshotName string, rehash bool) error SnapshotHashStatus(engine *longhorn.Engine, snapshotName string) (map[string]*longhorn.HashStatus, error)