2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2025-12-14 15:03:12 +00:00

add "append-to-cmdline" option

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2022-08-07 18:24:02 +02:00
parent 92cd70430b
commit 0c24236da9
4 changed files with 28 additions and 23 deletions

View File

@@ -28,7 +28,7 @@ import (
"go.linka.cloud/d2vm/pkg/docker"
)
func Convert(ctx context.Context, img string, size int64, password string, output string) error {
func Convert(ctx context.Context, img string, size int64, password string, output string, cmdLineExtra string) error {
imgUUID := uuid.New().String()
tmpPath := filepath.Join(os.TempDir(), "d2vm", imgUUID)
if err := os.MkdirAll(tmpPath, os.ModePerm); err != nil {
@@ -67,7 +67,7 @@ func Convert(ctx context.Context, img string, size int64, password string, outpu
if format == "" {
format = "raw"
}
b, err := NewBuilder(ctx, tmpPath, imgUUID, "", size, r, format)
b, err := NewBuilder(ctx, tmpPath, imgUUID, "", size, r, format, cmdLineExtra)
if err != nil {
return err
}