This repository has been archived by the owner on Mar 27, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If there is certain symlink in the container image like this: /A --> /X/Y/Z AND if the "/X/Y/Z" doesn't exists on the host OS, then the current invocation to os.Stat will give errors saying that the "Could not obtain size for /X/Y/Z". This is because that it will follow the link to check the /X/Y/Z on the host. That is improper. The proper behaviour should be: From the perspective of the symlink inside the container image, the valid target file it pointing to is always some "existing file" in the container image. From the perspective of the host OS, it should just respect the "closure" of the file system inside the container image. To resolve it, instead of the os.Stat, we can use os.Lstat which will not follow the link to check the target file. Signed-off-by: zhongjie <[email protected]>
- Loading branch information