Skip to content

Conversation

@rzlink
Copy link
Collaborator

@rzlink rzlink commented Nov 17, 2025

Fixes copying from Windows container mount roots by detecting and skipping protected system files ('System Volume Information' and 'WcSandboxState') that cause 'Access is denied' errors.

Changes:

  • Added platformCopy wrapper for Windows copy operations
  • Implemented manual directory enumeration to skip protected files
  • Enabled test case testCopyRelativeParents and testCopyParentsMissingDirectory on Windows

The fix is Windows-specific and only activates when copying from mount roots where protected files exist. All other copy operations use the standard path.

Issue: Resolves #6635 [v0.26] WCOW: Fix COPY --parents tests

Fixes copying from Windows container mount roots by detecting and skipping
protected system files ('System Volume Information' and 'WcSandboxState')
that cause 'Access is denied' errors.

Changes:
- Added platformCopy wrapper for Windows copy operations
- Implemented manual directory enumeration to skip protected files
- Enabled test case testCopyRelativeParents and testCopyParentsMissingDirectory on Windows

The fix is Windows-specific and only activates when copying from mount roots
where protected files exist. All other copy operations use the standard path.

Issue: Resolves #6635 [v0.26] WCOW: Fix COPY --parents tests
Signed-off-by: Dawei Wei <[email protected]>
@rzlink rzlink force-pushed the fix-windows-copy-with-protected-files branch from 6cf5edd to a5aebfe Compare November 17, 2025 23:59
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be simplified when integrating directly to copy.Copy where it already calls RootPath and ReadDir ?

@rzlink
Copy link
Collaborator Author

rzlink commented Nov 25, 2025

Could this be simplified when integrating directly to copy.Copy where it already calls RootPath and ReadDir ?

Yes, it will simplify to:

func platformCopy(ctx context.Context, srcRoot string, src string, destRoot string, dest string, opt ...copy.Opt) error {
	// Add Windows protected files to exclude patterns
	opt = append(opt,
		copy.WithExcludePattern("System Volume Information"),
		copy.WithExcludePattern("WcSandboxState"),
	)
	return copy.Copy(ctx, srcRoot, src, destRoot, dest, opt...)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants