fix: missing setup managerId for snapshot

This commit is contained in:
ioito
2019-08-14 20:07:41 +08:00
parent ee5ff1a013
commit 24936d42f1
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -31,6 +31,7 @@ type SSnapshotCreateInput struct {
DiskType string `json:"disk_type"`
CloudregionId string `json:"cloudregion_id"`
OutOfChain bool `json:"out_of_chain"`
ManagerId string `json:"manager_id"`
}
type SSnapshotPolicyCreateInput struct {
+4
View File
@@ -281,6 +281,10 @@ func (manager *SSnapshotManager) ValidateCreateData(ctx context.Context, userCre
if cloudregion := storage.GetRegion(); cloudregion != nil {
input.CloudregionId = cloudregion.GetId()
}
provider := disk.GetCloudprovider()
if provider != nil {
input.ManagerId = provider.Id
}
return input.JSON(input), nil
}