Skip to content

Validate container path is absolute in VolumeMount::Parse#40085

Merged
benhillis merged 3 commits intofeature/wsl-for-appsfrom
user/benhill/review_volume-mount-validation
Apr 3, 2026
Merged

Validate container path is absolute in VolumeMount::Parse#40085
benhillis merged 3 commits intofeature/wsl-for-appsfrom
user/benhill/review_volume-mount-validation

Conversation

@benhillis
Copy link
Copy Markdown
Member

Add validation that non-empty container paths must start with '/' since they are Linux paths inside the container. This catches cases where Windows drive letter colons (e.g. C:\path) get misinterpreted as the host:container separator, producing invalid container paths like '\hostPath' instead of '/containerPath'.

Previously, 'C:\hostPath:ro' would silently parse as host='C', container='\hostPath', mode=ro - now it throws a clear error.

Updated tests to reflect the new validation and moved previously 'valid' but semantically incorrect cases to a new VolumeMount_Parse_InvalidContainerPath test.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants