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

Commit 81d42e4

Browse files
committed
bugfix: can't create pod due to miss of shim-init.pid
Old version runv won't create shim-init.pid, so for handling backward compatibility problem, ignore the old dir for composing POD. Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
1 parent cfd4695 commit 81d42e4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

create.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ func findSharedContainer(root, nsPath string) (container string, err error) {
432432
shimPidFile := filepath.Join(absRoot, item.Name(), "shim-init.pid")
433433
spidByte, err := ioutil.ReadFile(shimPidFile)
434434
if err != nil {
435-
return "", fmt.Errorf("failed to read shim pid file %q: %v", shimPidFile, err)
435+
// for backward compatibility, if dir doesn't contain "shim-init.pid"
436+
// it could be old legacy dir, ignore and skip it.
437+
continue
436438
}
437439
spid := strings.TrimSpace(string(spidByte))
438440
if pid == spid {

0 commit comments

Comments
 (0)