Skip to content

Commit

Permalink
Merge pull request #271 from zinefer/bugfix-create-bind-mounts
Browse files Browse the repository at this point in the history
Allow the creation of bind mounts for lxc containers
  • Loading branch information
mleone87 authored Dec 6, 2023
2 parents c672c5e + a8777ab commit efb8bd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions proxmox/config_lxc.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ func (config ConfigLxc) mapToApiValues() map[string]interface{} {
// add mp to lxc parameters
mpID := mpConfMap["slot"]
mpName := fmt.Sprintf("mp%v", mpID)

paramMap[mpName] = FormatDiskParam(mpConfMap)
}

Expand Down
5 changes: 4 additions & 1 deletion proxmox/config_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,10 @@ func FormatDiskParam(disk QemuDevice) string {

if volume, ok := disk["volume"]; ok && volume != "" {
diskConfParam = append(diskConfParam, volume.(string))
diskConfParam = append(diskConfParam, fmt.Sprintf("size=%v", disk["size"]))

if size, ok := disk["size"]; ok && size != "" {
diskConfParam = append(diskConfParam, fmt.Sprintf("size=%v", disk["size"]))
}
} else {
volumeInit := fmt.Sprintf("%v:%v", disk["storage"], DiskSizeGB(disk["size"]))
diskConfParam = append(diskConfParam, volumeInit)
Expand Down

0 comments on commit efb8bd6

Please sign in to comment.