Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions daemon/pod/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ func (p *XPod) createSandbox(spec *apitypes.UserPod) error {
p.Log(ERROR, err)
return err
}
if sandbox == nil {
p.Log(ERROR, "startSandbox returns no sandbox and no error")
return errors.ErrSandboxNotExist
}

config := &runv.SandboxConfig{
Hostname: spec.Hostname,
Expand Down
6 changes: 6 additions & 0 deletions errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ var (
HTTPStatusCode: http.StatusInternalServerError,
})

ErrSandboxNotExist = errcode.Register(errGroup, errcode.ErrorDescriptor{
Value: "HYPER_SANDBOX_NOT_EXIST",
Message: "sandbox does not exist",
HTTPStatusCode: http.StatusPreconditionFailed,
})

ErrPodNotAlive = errcode.Register(errGroup, errcode.ErrorDescriptor{
Value: "HYPER_POD_NOT_ALIVE",
Message: "cannot complete the operation, because the pod %s is not alive",
Expand Down