feat: bind vol
package virt
import (
+ "fmt"
"path/filepath"
"strconv"
"strings"
@@ -23,7 +24,14 @@ func (v *Virt) parseVolumes(opts *enginetypes.VirtualizationCreateOptions) (map[
return nil, coretypes.NewDetailedErr(coretypes.ErrInvalidBind, bind)
}
- mnt := filepath.Join("/", parts[1])
+ src := parts[0]
+ dest := filepath.Join("/", parts[1])
+
+ mnt := dest
+ // the src part has been translated to real host directory by eru-sched or kept it to empty.
+ if len(src) > 0 {
+ mnt = fmt.Sprintf("%s:%s", src, dest)
+ }
cap, err := strconv.ParseInt(parts[3], 10, 64)
if err != nil {
