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

Commit dc966a8

Browse files
committed
Merge pull request #327 from gao-feng/build
build: fix incorrect podId in ContainerWait
2 parents 6324fd3 + 2b764c5 commit dc966a8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

daemon/daemonbuilder/pod.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,17 @@ func (d Docker) ContainerWait(cId string, timeout time.Duration) (int, error) {
225225
return -1, fmt.Errorf("no vm is running")
226226
}
227227

228-
podId, isCopyPod := d.hyper.CopyPods[cId]
229-
podId, isBasicPod := d.hyper.BasicPods[cId]
230-
if !isCopyPod && !isBasicPod {
228+
var podId string
229+
230+
copyId, isCopyPod := d.hyper.CopyPods[cId]
231+
basicId, isBasicPod := d.hyper.BasicPods[cId]
232+
233+
switch {
234+
case isCopyPod:
235+
podId = copyId
236+
case isBasicPod:
237+
podId = basicId
238+
default:
231239
return -1, fmt.Errorf("container %s doesn't belong to pod", cId)
232240
}
233241

0 commit comments

Comments
 (0)