Fix vitastor-cli create syntax

rdma-flow-control
Vitaliy Filippov 2023-03-17 11:11:52 +03:00
parent 2fb0c85618
commit 3bbc46543d
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ package vitastor
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"fmt"
"strings" "strings"
"bytes" "bytes"
"strconv" "strconv"
@ -178,7 +179,7 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
} }
// Create image using vitastor-cli // Create image using vitastor-cli
_, err := invokeCLI(ctxVars, []string{ "create", volName, "-s", string(volSize), "--pool", string(poolId) }) _, err := invokeCLI(ctxVars, []string{ "create", volName, "-s", fmt.Sprintf("%v", volSize), "--pool", fmt.Sprintf("%v", poolId) })
if (err != nil) if (err != nil)
{ {
if (strings.Index(err.Error(), "already exists") > 0) if (strings.Index(err.Error(), "already exists") > 0)