runtime: Files are not synced between host and guest VMs

This PR makes the root dir absolute after resolving the
default root dir symlink. 

Fixes: https://github.com/kata-containers/kata-containers/issues/10499

Signed-off-by: Silenio Quarti <silenio_quarti@ca.ibm.com>
This commit is contained in:
Silenio Quarti 2024-11-06 17:31:12 -05:00
parent a3c72e59b1
commit be3ea2675c

View File

@ -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
}