mirror of
https://github.com/cristicalin/synology-csi.git
synced 2026-05-06 21:12:39 +00:00
Update to version 1.0.1
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user