Skip to content

volume-mounts replace symlinks with full path for both src and dest #1859

Open
@MallocArray

Description

@MallocArray
ISSUE TYPE
  • Bug Report
SUMMARY

When setting a dest: path that is a symlink on the host device, it is converted to the host's local path inside of the EE instead of the container's

ANSIBLE-NAVIGATOR VERSION
ansible-navigator 24.9.0
CONFIGURATION
ansible-navigator:
  execution-environment:
    volume-mounts:
      - src: /root/.azure
        dest: /root/.azure
LOG FILE

Relevant entry:

2024-10-02T20:52:57.214842+00:00 DEBUG 'ansible_navigator.main'  before: '[{'src': '/root/.azure', 'dest': '/root/.azure'}]'
2024-10-02T20:52:57.214866+00:00 DEBUG 'ansible_navigator.main'  after: '['/mnt/c/Users/username/.azure:/mnt/c/Users/username/.azure']'
STEPS TO REPRODUCE

Using Windows 10 with WSL Ubuntu 22.04
WSL has azure credential files located in /root/.azure folder, which is a symlink to the mount folder for the Windows filesystem
lrwxrwxrwx 1 root root 26 Jun 28 2023 .azure -> /mnt/c/Users/username/.azure

Trying to expose these same files inside of the EE when using ansible-navigator so it has the Azure credentials to retrieve Azure Key Vault secrets. Add a volume mount for /root/.azure as the source and destination so these files are in the expected location inside of the EE

EXPECTED RESULTS

Inside of the EE when ansible-navigator is ran, the folder /root/.azure will be mounted

ACTUAL RESULTS

/root/.azure is not present.
Reviewing debug logs shows that the symlink path is expanded for the source and destination. The source makes sense, but should not also be expanded as the destination path
Inside of the EE, the folder is mounted at /mnt/c/Users/username/.azure which does not address the reason it is being mounted
If the destination is set to a path that is not a symlink on the host system, it appears as expected, such as a destination of /root/.azure2 would mount as expected

ADDITIONAL INFORMATION

Doing the same volume mount with docker run directly works as expected with the folder being mounted where specified. This appears to be specific to ansible-navigator in my environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugResearched, reproducible, committed to fix

    Type

    No type

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions