diff --git a/src/runtime/virtcontainers/fs_share_linux.go b/src/runtime/virtcontainers/fs_share_linux.go index 73c6922ea..0dc11cbed 100644 --- a/src/runtime/virtcontainers/fs_share_linux.go +++ b/src/runtime/virtcontainers/fs_share_linux.go @@ -64,6 +64,14 @@ func resolveRootDir() string { // Use the default root dir in case of any errors resolving the root dir symlink return defaultKubernetesRootDir } + // Make root dir an absolute path if needed + if !filepath.IsAbs(rootDir) { + rootDir, err = filepath.Abs(filepath.Join(filepath.Dir(defaultKubernetesRootDir), rootDir)) + if err != nil { + // Use the default root dir in case of any errors resolving the root dir symlink + return defaultKubernetesRootDir + } + } return rootDir }