Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCI: Prevent tmpfs mounts in config.json from overriding own mounts #1832

Closed
DanielAdolfsson opened this issue Mar 23, 2025 · 3 comments · Fixed by #1834
Closed

OCI: Prevent tmpfs mounts in config.json from overriding own mounts #1832

DanielAdolfsson opened this issue Mar 23, 2025 · 3 comments · Fixed by #1834
Assignees
Milestone

Comments

@DanielAdolfsson
Copy link

DanielAdolfsson commented Mar 23, 2025

Right now, it seems like our provided devices (mounts) are added before mounts defined in config.json.
This makes it so any tmpfs mounts inside config.json overwrites the mount provided by the user (if any).
Some images seem to set up a tmpfs mounts for certain volumes in case the user doesn't bind it to anything?

Maybe the tmpfs mounts provided by the oci image could be set up before the devices?

@stgraber
Copy link
Member

Can you provide a reproducer for this?

The logic certainly is supposed to skip mounting on paths that are already handled by a device.

@stgraber stgraber added the Incomplete Waiting on more information from reporter label Mar 23, 2025
@DanielAdolfsson
Copy link
Author

The particular image I was using is docker:teamspeak .

incus create docker:teamspeak  teamspeak
incus config device add teamspeak teamspeak_data disk source=./data path=/var/ts3server
incus start teamspeak --console

I did, however, notice that the mount destination inside config.json is /var/ts3server/, and I used path /var/ts3server. Note the ending /. Once I amended my device add to also include the ending /, it started working.

Maybe the paths should be normalized before they are used.

@stgraber
Copy link
Member

Ah yeah, it'd be pretty likely that we're not normalizing the paths before comparison, explaining what you're seeing.

@stgraber stgraber removed the Incomplete Waiting on more information from reporter label Mar 23, 2025
@stgraber stgraber self-assigned this Mar 23, 2025
@stgraber stgraber added this to the incus-6.11 milestone Mar 23, 2025
@hallyn hallyn closed this as completed in 362e447 Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants