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

Commit 2fe3bfa

Browse files
committed
fix the issue of start container failed after restore pod
It's needed to reload sandbox before containers, since the container's reload needs the sandbox. Signed-off-by: Fupan Li <lifupan@gmail.com>
1 parent 73b8c47 commit 2fe3bfa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

daemon/pod/persist.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@ func LoadXPod(factory *PodFactory, layout *types.PersistPodLayout) (*XPod, error
108108
}
109109
}
110110

111-
for _, cid := range layout.Containers {
112-
if err = p.loadContainer(cid); err != nil {
113-
return nil, err
114-
}
115-
}
116-
117111
err = p.loadSandbox()
118112
if err != nil {
119113
if !strings.Contains(err.Error(), "leveldb: not found") {
@@ -123,6 +117,12 @@ func LoadXPod(factory *PodFactory, layout *types.PersistPodLayout) (*XPod, error
123117
p.status = S_POD_STOPPED
124118
}
125119

120+
for _, cid := range layout.Containers {
121+
if err = p.loadContainer(cid); err != nil {
122+
return nil, err
123+
}
124+
}
125+
126126
// if sandbox is running, set all volume INSERTED
127127
if p.status == S_POD_RUNNING {
128128
for _, v := range p.volumes {

0 commit comments

Comments
 (0)