mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-26 15:32:30 +00:00
runtime: don't fail mkdir if the folder is already created
Use MkdirAll instead of Mkdir so it doesn't generate an error when the folder is created by another process Fixes #5713 Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
This commit is contained in:
parent
7c8d474959
commit
4b45e13869
@ -399,7 +399,7 @@ func MkdirAllWithInheritedOwner(path string, perm os.FileMode) error {
|
||||
info, err := os.Stat(curPath)
|
||||
|
||||
if err != nil {
|
||||
if err = os.Mkdir(curPath, perm); err != nil {
|
||||
if err = os.MkdirAll(curPath, perm); err != nil {
|
||||
return fmt.Errorf("mkdir call failed: %v", err.Error())
|
||||
}
|
||||
if err = syscall.Chown(curPath, uid, gid); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user