Skip to content

Commit cb96426

Browse files
author
Zhou Hao
authored
Merge pull request #600 from kinvolk/alban/cli-order
validation: run CLI with correct argument order
2 parents 3a83c2c + 79ae4aa commit cb96426

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

validation/util/container.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ func (r *Runtime) SetID(id string) {
6969
func (r *Runtime) Create() (err error) {
7070
var args []string
7171
args = append(args, "create")
72-
if r.ID != "" {
73-
args = append(args, r.ID)
74-
}
7572
if r.PidFile != "" {
7673
args = append(args, "--pid-file", r.PidFile)
7774
}
7875
if r.BundleDir != "" {
7976
args = append(args, "--bundle", r.BundleDir)
8077
}
78+
if r.ID != "" {
79+
args = append(args, r.ID)
80+
}
8181
cmd := exec.Command(r.RuntimeCommand, args...)
8282
id := uuid.NewV4().String()
8383
r.stdout, err = os.OpenFile(filepath.Join(r.bundleDir(), fmt.Sprintf("stdout-%s", id)), os.O_CREATE|os.O_EXCL|os.O_RDWR, 0600)

0 commit comments

Comments
 (0)