Skip to content

Conversation

@ttys3
Copy link

@ttys3 ttys3 commented Dec 4, 2025

  • Convert relative paths (e.g., ./data/postgres) to normalized absolute paths
  • Use URL.standardizedFileURL to remove ./ and ../ components
  • Pass absolute paths to container run -v command instead of relative paths
  • Fixes issue where container tool incorrectly treats relative paths as named volume names

The container tool requires absolute paths for bind mounts. Previously, relative paths like './data/postgres' were passed directly, causing the tool to validate them as named volume names (which must match ^[A-Za-z0-9][A-Za-z0-9_.-]*$), resulting in validation errors.

fix #4

- Convert relative paths (e.g., ./data/postgres) to normalized absolute paths
- Use URL.standardizedFileURL to remove ./ and ../ components
- Pass absolute paths to container run -v command instead of relative paths
- Fixes issue where container tool incorrectly treats relative paths as named volume names

The container tool requires absolute paths for bind mounts. Previously, relative
paths like './data/postgres' were passed directly, causing the tool to validate
them as named volume names (which must match ^[A-Za-z0-9][A-Za-z0-9_.-]*$),
resulting in validation errors.
@oxisto
Copy link

oxisto commented Jan 30, 2026

  • Convert relative paths (e.g., ./data/postgres) to normalized absolute paths
  • Use URL.standardizedFileURL to remove ./ and ../ components
  • Pass absolute paths to container run -v command instead of relative paths
  • Fixes issue where container tool incorrectly treats relative paths as named volume names

The container tool requires absolute paths for bind mounts. Previously, relative paths like './data/postgres' were passed directly, causing the tool to validate them as named volume names (which must match ^[A-Za-z0-9][A-Za-z0-9_.-]*$), resulting in validation errors.

fix #4

I may also need this for #49

@Mcrich23
Copy link
Owner

I would be happy to merge it. The PR just needs unit testing first.

@oxisto
Copy link

oxisto commented Jan 30, 2026

I would be happy to merge it. The PR just needs unit testing first.

I can help. What kind of tests are you looking for? It seems the configVolume is not really tested on its own - it might also be difficult since it both calculates the runCommandArgs but also does some file operations on its own, which is probably not ideal for a unit test. I am not an expert on swift, is there a way to mock the filesystem before testing this function?

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.

Support Relative Bind Mounts

3 participants