Location: internal/sync/tar.go, Sync() function
Problem:
The current logic buckets paths into copy vs delete:
if _, err := os.Stat(p.HostPath); err != nil && errors.Is(err, fs.ErrNotExist) {
pathsToDelete = append(pathsToDelete, p.ContainerPath)
} else {
pathsToCopy = append(pathsToCopy, *p)
}
Non-NotExist errors (e.g. EACCES, EIO) are silently ignored and the path is
treated as copyable. This means permission or IO errors don't stop the sync ,
the operation may fail later in a less obvious place with the original cause lost.
Expected behavior:
if err == nil {
pathsToCopy = append(pathsToCopy, *p)
} else if errors.Is(err, fs.ErrNotExist) {
pathsToDelete = append(pathsToDelete, p.ContainerPath)
} else {
return fmt.Errorf("stat %q: %w", p.HostPath, err)
}