Convert status to exit code
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
26262dff00
commit
17b6f3b64c
2 changed files with 6 additions and 1 deletions
|
@ -171,7 +171,7 @@ func (r *Runtime) UpdateStatus(c *Container) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("status code conversion failed: %v", err)
|
return fmt.Errorf("status code conversion failed: %v", err)
|
||||||
}
|
}
|
||||||
c.state.ExitCode = int32(statusCode)
|
c.state.ExitCode = int32(utils.StatusToExitCode(statusCode))
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -125,3 +125,8 @@ func StartReaper() {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StatusToExitCode converts wait status code to an exit code
|
||||||
|
func StatusToExitCode(status int) int {
|
||||||
|
return ((status) & 0xff00) >> 8
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue