Fix createParents in vminitd copy handler#590
Fix createParents in vminitd copy handler#590simone-panico wants to merge 1 commit intoapple:mainfrom
Conversation
| } | ||
| let destURL = URL(fileURLWithPath: path) | ||
| try FileManager.default.createDirectory(at: destURL, withIntermediateDirectories: true) | ||
| try FileManager.default.createDirectory(at: destURL, withIntermediateDirectories: request.createParents) |
There was a problem hiding this comment.
I feel like this should remain withIntermediateDirectories: true. We already make parent directories in L414. Directory here is to unpack the tar archive.
There was a problem hiding this comment.
I can't do the retry-based approach in container#1190 without this because the CLI needs the first copyIn(src, dst/basename, createParents=false) to fail if dst doesn't exist.
If withIntermediateDirectories is always true, the createDirectory creates dst as a side effect, the copy lands at the wrong path and the error-based retry never triggers
There was a problem hiding this comment.
Yes. We are stuck :(
Sorry for taking up your time. We'll think it over a bit more and let you know once we've decided on a direction.
There was a problem hiding this comment.
No worries, take your time. Just let me know once you've settled on a direction :)
Respect
createParentsflag when creating the destination directory for archive extraction.