Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit ffa2b2c

Browse files
committed
pop up startPod error
Signed-off-by: Peng Tao <bergwolf@gmail.com>
1 parent 652ea59 commit ffa2b2c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

hypervisor/vm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ func (vm *Vm) WaitProcess(isContainer bool, ids []string, timeout int) <-chan *a
226226
return result
227227
}
228228

229-
func (vm *Vm) InitSandbox(config *api.SandboxConfig) {
229+
func (vm *Vm) InitSandbox(config *api.SandboxConfig) error {
230230
vm.ctx.SetNetworkEnvironment(config)
231-
vm.ctx.startPod()
231+
return vm.ctx.startPod()
232232
}
233233

234234
func (vm *Vm) WaitInit() api.Result {

hypervisor/vm_states.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,17 @@ func streamCopy(tty *TtyIO, stdinPipe io.WriteCloser, stdoutPipe, stderrPipe io.
181181
once.Do(cleanup)
182182
}
183183

184-
func (ctx *VmContext) startPod() {
184+
func (ctx *VmContext) startPod() error {
185185
err := ctx.hyperstart.StartSandbox(ctx.networks.sandboxInfo())
186186
if err == nil {
187187
ctx.Log(INFO, "pod start successfully")
188188
ctx.reportSuccess("Start POD success", []byte{})
189189
} else {
190-
reason := "Start POD failed"
190+
reason := fmt.Sprintf("Start POD failed: %s", err.Error())
191191
ctx.reportVmFault(reason)
192192
ctx.Log(ERROR, reason)
193193
}
194+
return err
194195
}
195196

196197
func (ctx *VmContext) shutdownVM() {

0 commit comments

Comments
 (0)