mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc: Fix a bug that runsc wait doesn't work after container exits.
PiperOrigin-RevId: 213849165 Change-Id: I5120b2f568850c0c42a08e8706e7f8653ef1bd94
This commit is contained in:
@@ -139,6 +139,7 @@ func Load(rootDir, id string) (*Container, error) {
|
||||
if !c.Sandbox.IsRunning() {
|
||||
// Sandbox no longer exists, so this container definitely does not exist.
|
||||
c.changeStatus(Stopped)
|
||||
c.Sandbox = nil
|
||||
} else if c.Status == Running {
|
||||
// Container state should reflect the actual state of
|
||||
// the application, so we don't consider gofer process
|
||||
@@ -682,7 +683,6 @@ func (c *Container) changeStatus(s Status) {
|
||||
if c.Status != Created && c.Status != Running && c.Status != Stopped {
|
||||
panic(fmt.Sprintf("invalid state transition: %v => %v", c.Status, s))
|
||||
}
|
||||
c.Sandbox = nil
|
||||
|
||||
default:
|
||||
panic(fmt.Sprintf("invalid new state: %v", s))
|
||||
|
||||
Reference in New Issue
Block a user