mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
fix: missing setup managerId for snapshot
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user