nerdctl
nerdctl copied to clipboard
cp fails to detect readonly mount and fallback into tar error
Description
This
https://github.com/containerd/nerdctl/blob/main/pkg/containerutil/cp_linux.go#L305
should surface error: "mount point %s is marked read-only"
This is two fold:
- error message
- more importantly, the logic in getContainerMountInfo seems to be broken
Steps to reproduce the issue
touch something
nerdctl volume create foo
nerdctl run -d --name testro -v foo:/bar:ro debian sleep Inf
nerdctl cp something testro:/bar
Describe the results you received and expected
Received:
/usr/bin/tar: something: Cannot open: Read-only file system
/usr/bin/tar: Exiting with failure status due to previous errors
FATA[0000] could not find container: testro, with error: failed to wait [nsenter -t 1958627 -U --preserve-credentials -- /usr/bin/tar -x -f -]: exit status 2
Expected:
mount point %s is marked read-only
What version of nerdctl are you using?
main
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
None
Host information
Am I missing something or doing something wrong?