Update to version 1.0.1

This commit is contained in:
chihyuwu
2022-02-14 07:56:51 +00:00
parent bca0c705f0
commit 515bc7f0ed
18 changed files with 525 additions and 20 deletions

View File

@@ -24,7 +24,7 @@ import (
const (
DriverName = "csi.san.synology.com" // CSI dirver name
DriverVersion = "1.0.0"
DriverVersion = "1.0.1"
)
type IDriver interface {

View File

@@ -394,6 +394,18 @@ func (service *DsmService) CreateVolume(spec *models.CreateK8sVolumeSpec) (webap
continue
}
// found source by snapshot id, check allowable
if spec.DsmIp != "" && spec.DsmIp != dsm.Ip {
msg := fmt.Sprintf("The source PVC and destination PVCs must be on the same DSM for cloning from snapshots. Source is on %s, but new PVC is on %s",
dsm.Ip, spec.DsmIp)
return webapi.LunInfo{}, "", status.Errorf(codes.InvalidArgument, msg)
}
if spec.Location != "" && spec.Location != snapshotInfo.RootPath {
msg := fmt.Sprintf("The source PVC and destination PVCs must be on the same location for cloning from snapshots. Source is on %s, but new PVC is on %s",
snapshotInfo.RootPath, spec.Location)
return webapi.LunInfo{}, "", status.Errorf(codes.InvalidArgument, msg)
}
lunInfo, err := service.createVolumeBySnapshot(dsm, spec, snapshotInfo)
return lunInfo, dsm.Ip, err
}

View File

@@ -58,6 +58,7 @@ type SnapshotInfo struct {
Status string `json:"status"`
TotalSize int64 `json:"total_size"`
CreateTime int64 `json:"create_time"`
RootPath string `json:"root_path"`
}
type LunDevAttrib struct {