Skip to content

Commit

Permalink
Pvc from source with different isi paths (#15)
Browse files Browse the repository at this point in the history
* support to create pvc from snapshot with different isi path

* removed temporary debug logs

Co-authored-by: Bahubali Jain <[email protected]>
  • Loading branch information
bpjain2004 and Bahubali Jain authored Jan 10, 2022
1 parent 535fa50 commit 83d13e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/v1/api_v1_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ func CopyIsiSnapshot(
func CopyIsiSnapshotWithIsiPath(
ctx context.Context,
client api.Client,
isiPath, sourceSnapshotName, sourceVolume, destinationName string) (resp *IsiVolume, err error) {
isiPath, snapshotSourceVolumeIsiPath, sourceSnapshotName, sourceVolume, destinationName string) (resp *IsiVolume, err error) {
// PAPI calls: PUT https://1.2.3.4:8080/namespace/path/to/volumes/destination_volume_name?merge=True
// x-isi-ifs-copy-source: /path/to/snapshot/volumes/source_volume_name
// x-isi-ifs-mode-mask: preserve
headers := map[string]string{
"x-isi-ifs-copy-source": path.Join(
"/",
GetRealVolumeSnapshotPathWithIsiPath(isiPath, sourceSnapshotName),
GetRealVolumeSnapshotPathWithIsiPath(snapshotSourceVolumeIsiPath, sourceSnapshotName),
sourceVolume),
"x-isi-ifs-mode-mask": "preserve",
}
Expand Down
4 changes: 2 additions & 2 deletions snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (c *Client) CopySnapshot(
// CopySnapshotWithIsiPath copies all files/directories in a snapshot with isiPath to a new directory.
func (c *Client) CopySnapshotWithIsiPath(
ctx context.Context,
isiPath string,
isiPath, snapshotSourceVolumeIsiPath string,
sourceID int64,
sourceName, destinationName string) (Volume, error) {

Expand All @@ -152,7 +152,7 @@ func (c *Client) CopySnapshotWithIsiPath(
}

_, err = api.CopyIsiSnapshotWithIsiPath(
ctx, c.API, isiPath, snapshot.Name,
ctx, c.API, isiPath, snapshotSourceVolumeIsiPath, snapshot.Name,
path.Base(snapshot.Path), destinationName)
if err != nil {
return nil, err
Expand Down

0 comments on commit 83d13e1

Please sign in to comment.