Podman generate kube produces incorrect configuration when bind-mounting "/" and "/root" simultaneously #9764
Labels
Good First Issue
This issue would be a good issue for a first time contributor to undertake.
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When generating Kubernetes YAML from a Podman container which bind-mounts both
/
and/root
only one volume is created.I noticed that this would be an issue when I saw how the hostPath
/
is renamed toroot
, which conflicts with the name of the volume for/root
, i.e.root
.There's a reason systemd uses
-
to represent the filesystem's root/
.Steps to reproduce the issue:
/
and/root
.$ sudo podman run -d --pod "new:mount-root-conflict" -v /:/volume1/ -v /root:/volume2/ --name mount-root-ctr alpine
hostPath
section in thevolumes
section instead of two.Describe the results you received:
Only one volume is generated instead of two.
This leads to
/root
being mounted in both locations instead of/
being mounted at one and/root
at the other.Describe the results you expected:
Two volumes should have been generated, one for
/
and another for/root
.Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Built from source.
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Run from within a GNOME Boxes virtual machine.
The text was updated successfully, but these errors were encountered: