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

Podman 4.x Pod volume mounts #13548

Closed
daynyxx opened this issue Mar 17, 2022 · 12 comments · Fixed by #13594
Closed

Podman 4.x Pod volume mounts #13548

daynyxx opened this issue Mar 17, 2022 · 12 comments · Fixed by #13594
Assignees
Labels
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.

Comments

@daynyxx
Copy link

daynyxx commented Mar 17, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description
When trying adding containers to a pod that has volume mounts, the containers do not have any of the volumes mounted

Steps to reproduce the issue:

  1. create pod with a volume mount
podman pod create --name=test -v /home/user/test:/test
  1. then run a container
    podman run --pod=test fedora touch /test/test.file

Describe the results you received:
touch: cannot touch '/test/test.file': No such file or directory
The container will say the folder/file does not exist

Describe the results you expected:
The container will have the volume mounts from the pod it is a part of

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

podman version 4.0.2

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.24.1
  cgroupControllers:
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.0-2.fc35.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: '
  cpus: 12
  distribution:
    distribution: fedora
    variant: server
    version: "35"
  eventLogger: journald
  hostname: kuroda.home.pf
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.16.14-200.fc35.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 30800465920
  memTotal: 32983187456
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.4.3-1.fc35.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.4.3
      commit: 61c9600d1335127eba65632731e2d72bc3f0b9e8
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.12-2.fc35.x86_64
    version: |-
      slirp4netns version 1.1.12
      commit: 7a104a101aa3278a2152351a082a6df71f57c9a3
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 25769795584
  swapTotal: 25769795584
  uptime: 19m 47.53s
plugins:
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /home/kuroda/.config/containers/storage.conf
  containerStore:
    number: 2
    paused: 0
    running: 2
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/kuroda/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 4
  runRoot: /run/user/1000/containers
  volumePath: /home/kuroda/.local/share/containers/storage/volumes
version:
  APIVersion: 4.0.2
  Built: 1646943965
  BuiltTime: Thu Mar 10 15:26:05 2022
  GitCommit: ""
  GoVersion: go1.16.14
  OsArch: linux/amd64
  Version: 4.0.2

Package info (e.g. output of rpm -q podman or apt list podman):
podman-4.0.2-5.fc35.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes

Additional environment details (AWS, VirtualBox, physical, etc.):
This is running on my current desktop. The mounts do work when I mount them directly too the container. The latest documentation about the podman pod create --volume command here seems to imply that containers in that pod will all share the mounts defined in the create command, but that isn't working in my case. I have tried running with all of the propagation option as well.

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 17, 2022
@cdoern
Copy link
Contributor

cdoern commented Mar 17, 2022

hm, I will look at this one. I am assuming there is some issue with the infra container design.

@cdoern cdoern self-assigned this Mar 17, 2022
@cdoern
Copy link
Contributor

cdoern commented Mar 17, 2022

I cannot reproduce this on the main branch @daynyxx have you tried building podman from the github repo and testing your issue?

@daynyxx
Copy link
Author

daynyxx commented Mar 18, 2022

@cdoern build from main and still running into this problem.

create pod:
podman pod create --name=test -v /home/kuroda/pod-test:/test

run ls on /test:
podman run --pod=test fedora ls /test

result:
ls: cannot access '/test': No such file or directory

run ls on /:
podman run --pod=test fedora ls /

result:

bin
boot
dev
etc
home
lib
lib64
lost+found
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var

@rhatdan
Copy link
Member

rhatdan commented Mar 18, 2022

$ mkdir pod-test
$ podman pod create --name pod-test -v pod-test:/test:Z 
704ef301b61d6f031eb2126e4442d9b8ad3b403ae2cf397b8688f9d2ce521592
$ podman run --pod pod-test alpine ls -ld /test
Resolved "alpine" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/alpine:latest...
Getting image source signatures
Copying blob 3d2430473443 done  
Copying config e9adb5357e done  
Writing manifest to image destination
Storing signatures
drwxr-xr-x    2 root     root             6 Mar 18 07:21 /test
$ podman -v
podman version 4.0.2

@rhatdan
Copy link
Member

rhatdan commented Mar 18, 2022

$ podman inspect -l --format '{{ .Mounts }}'
[{volume pod-test /home/dwalsh/.local/share/containers/storage/volumes/pod-test/_data /test local Z [nosuid nodev rbind] true rprivate}]

@daynyxx
Copy link
Author

daynyxx commented Mar 18, 2022

@rhatdan it did work when I ran the command you used both with and without :Z. It did not work however when I used the absolute path

$ )cd pod-test/
$ )pwd
/home/kuroda/pod-test
$ )cd .. && ls
pod-test
$ )podman pod create --name pod-test -v /home/kuroda/pod-test:/test
b27793360c01db3cf2926c0c1a22cc0a87e19281a4f84161721f0d544b7cc64f
$ )podman run --pod pod-test alpine ls -ld /test
ls: /test: No such file or directory
$ )podman inspect -l --format '{{ .Mounts }}'
WARN[0000] Could not find mount at destination "/test" when parsing user volumes for container da5efaf3e6fbb8f5ab69e328845da3f6bfeb9856e10dc88d41ad23082450f703
[]

@mheon
Copy link
Member

mheon commented Mar 18, 2022

Please include a podman inspect of one of these containers - want to see if we have any volumes added

@daynyxx
Copy link
Author

daynyxx commented Mar 18, 2022

This is when mounting a folder

$ )podman inspect ls-container
WARN[0000] Could not find mount at destination "/test" when parsing user volumes for container 589612ac25781a6c777a854c6194e28d14e8fc35aaca78a66e5c7791fbfc0bb7
[
     {
          "Id": "589612ac25781a6c777a854c6194e28d14e8fc35aaca78a66e5c7791fbfc0bb7",
          "Created": "2022-03-18T14:28:58.79028811-04:00",
          "Path": "ls",
          "Args": [
               "-ld",
               "/test"
          ],
          "State": {
               "OciVersion": "1.0.2-dev",
               "Status": "exited",
               "Running": false,
               "Paused": false,
               "Restarting": false,
               "OOMKilled": false,
               "Dead": false,
               "Pid": 0,
               "ExitCode": 1,
               "Error": "",
               "StartedAt": "2022-03-18T14:28:58.832694727-04:00",
               "FinishedAt": "2022-03-18T14:28:58.832473056-04:00",
               "Health": {
                    "Status": "",
                    "FailingStreak": 0,
                    "Log": null
               },
               "CheckpointedAt": "0001-01-01T00:00:00Z",
               "RestoredAt": "0001-01-01T00:00:00Z"
          },
          "Image": "e9adb5357e84d853cc3eb08cd4d3f9bd6cebdb8a67f0415cc884be7b0202416d",
          "ImageName": "docker.io/library/alpine:latest",
          "Rootfs": "",
          "Pod": "f03fb97655412d3146208a315b66520e35d5739744431142a5dab1ef88925cbd",
          "ResolvConfPath": "/run/user/1000/containers/overlay-containers/d0ea4476a70cf3040ec2ca82dd730b676f80250f8314e7a83a9f63e6c1f1622e/userdata/resolv.conf",
          "HostnamePath": "/run/user/1000/containers/overlay-containers/589612ac25781a6c777a854c6194e28d14e8fc35aaca78a66e5c7791fbfc0bb7/userdata/hostname",
          "HostsPath": "/run/user/1000/containers/overlay-containers/d0ea4476a70cf3040ec2ca82dd730b676f80250f8314e7a83a9f63e6c1f1622e/userdata/hosts",
          "StaticDir": "/home/kuroda/.local/share/containers/storage/overlay-containers/589612ac25781a6c777a854c6194e28d14e8fc35aaca78a66e5c7791fbfc0bb7/userdata",
          "OCIConfigPath": "/home/kuroda/.local/share/containers/storage/overlay-containers/589612ac25781a6c777a854c6194e28d14e8fc35aaca78a66e5c7791fbfc0bb7/userdata/config.json",
          "OCIRuntime": "crun",
          "ConmonPidFile": "/run/user/1000/containers/overlay-containers/589612ac25781a6c777a854c6194e28d14e8fc35aaca78a66e5c7791fbfc0bb7/userdata/conmon.pid",
          "PidFile": "/run/user/1000/containers/overlay-containers/589612ac25781a6c777a854c6194e28d14e8fc35aaca78a66e5c7791fbfc0bb7/userdata/pidfile",
          "Name": "ls-container",
          "RestartCount": 0,
          "Driver": "overlay",
          "MountLabel": "",
          "ProcessLabel": "",
          "AppArmorProfile": "",
          "EffectiveCaps": [
               "CAP_CHOWN",
               "CAP_DAC_OVERRIDE",
               "CAP_FOWNER",
               "CAP_FSETID",
               "CAP_KILL",
               "CAP_NET_BIND_SERVICE",
               "CAP_SETFCAP",
               "CAP_SETGID",
               "CAP_SETPCAP",
               "CAP_SETUID",
               "CAP_SYS_CHROOT"
          ],
          "BoundingCaps": [
               "CAP_CHOWN",
               "CAP_DAC_OVERRIDE",
               "CAP_FOWNER",
               "CAP_FSETID",
               "CAP_KILL",
               "CAP_NET_BIND_SERVICE",
               "CAP_SETFCAP",
               "CAP_SETGID",
               "CAP_SETPCAP",
               "CAP_SETUID",
               "CAP_SYS_CHROOT"
          ],
          "ExecIDs": [],
          "GraphDriver": {
               "Name": "overlay",
               "Data": {
                    "LowerDir": "/home/kuroda/.local/share/containers/storage/overlay/5e03d8cae8773cb694fff1d55da34a40d23c2349087ed15ce68476395d33753c/diff",
                    "UpperDir": "/home/kuroda/.local/share/containers/storage/overlay/8b74002495dc498ee0325373054fcff9c40baf091307f465d21cc2aab8b18e65/diff",
                    "WorkDir": "/home/kuroda/.local/share/containers/storage/overlay/8b74002495dc498ee0325373054fcff9c40baf091307f465d21cc2aab8b18e65/work"
               }
          },
          "Mounts": [],
          "Dependencies": [
               "d0ea4476a70cf3040ec2ca82dd730b676f80250f8314e7a83a9f63e6c1f1622e"
          ],
          "NetworkSettings": {
               "EndpointID": "",
               "Gateway": "",
               "IPAddress": "",
               "IPPrefixLen": 0,
               "IPv6Gateway": "",
               "GlobalIPv6Address": "",
               "GlobalIPv6PrefixLen": 0,
               "MacAddress": "",
               "Bridge": "",
               "SandboxID": "",
               "HairpinMode": false,
               "LinkLocalIPv6Address": "",
               "LinkLocalIPv6PrefixLen": 0,
               "Ports": {},
               "SandboxKey": "/run/user/1000/netns/netns-50ff1754-bf60-476b-d52f-025105070f3c"
          },
          "Namespace": "",
          "IsInfra": false,
          "Config": {
               "Hostname": "589612ac2578",
               "Domainname": "",
               "User": "",
               "AttachStdin": false,
               "AttachStdout": false,
               "AttachStderr": false,
               "Tty": false,
               "OpenStdin": false,
               "StdinOnce": false,
               "Env": [
                    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                    "TERM=xterm",
                    "container=podman",
                    "HOME=/root",
                    "HOSTNAME=pod-test"
               ],
               "Cmd": [
                    "ls",
                    "-ld",
                    "/test"
               ],
               "Image": "docker.io/library/alpine:latest",
               "Volumes": null,
               "WorkingDir": "/",
               "Entrypoint": "",
               "OnBuild": null,
               "Labels": null,
               "Annotations": {
                    "io.container.manager": "libpod",
                    "io.kubernetes.cri-o.ContainerType": "container",
                    "io.kubernetes.cri-o.Created": "2022-03-18T14:28:58.79028811-04:00",
                    "io.kubernetes.cri-o.SandboxID": "pod-test",
                    "io.kubernetes.cri-o.TTY": "false",
                    "io.podman.annotations.autoremove": "FALSE",
                    "io.podman.annotations.init": "FALSE",
                    "io.podman.annotations.privileged": "FALSE",
                    "io.podman.annotations.publish-all": "FALSE",
                    "org.opencontainers.image.stopSignal": "15"
               },
               "StopSignal": 15,
               "CreateCommand": [
                    "podman",
                    "run",
                    "--pod",
                    "pod-test",
                    "--name=ls-container",
                    "alpine",
                    "ls",
                    "-ld",
                    "/test"
               ],
               "Umask": "0022",
               "Timeout": 0,
               "StopTimeout": 10,
               "Passwd": true
          },
          "HostConfig": {
               "Binds": [],
               "CgroupManager": "systemd",
               "CgroupMode": "private",
               "ContainerIDFile": "",
               "LogConfig": {
                    "Type": "journald",
                    "Config": null,
                    "Path": "",
                    "Tag": "",
                    "Size": "0B"
               },
               "NetworkMode": "container:d0ea4476a70cf3040ec2ca82dd730b676f80250f8314e7a83a9f63e6c1f1622e",
               "PortBindings": {},
               "RestartPolicy": {
                    "Name": "",
                    "MaximumRetryCount": 0
               },
               "AutoRemove": false,
               "VolumeDriver": "",
               "VolumesFrom": null,
               "CapAdd": [],
               "CapDrop": [
                    "CAP_AUDIT_WRITE",
                    "CAP_MKNOD",
                    "CAP_NET_RAW"
               ],
               "Dns": [],
               "DnsOptions": [],
               "DnsSearch": [],
               "ExtraHosts": [],
               "GroupAdd": [],
               "IpcMode": "container:d0ea4476a70cf3040ec2ca82dd730b676f80250f8314e7a83a9f63e6c1f1622e",
               "Cgroup": "",
               "Cgroups": "default",
               "Links": null,
               "OomScoreAdj": 0,
               "PidMode": "private",
               "Privileged": false,
               "PublishAllPorts": false,
               "ReadonlyRootfs": false,
               "SecurityOpt": [],
               "Tmpfs": {},
               "UTSMode": "container:d0ea4476a70cf3040ec2ca82dd730b676f80250f8314e7a83a9f63e6c1f1622e",
               "UsernsMode": "",
               "ShmSize": 65536000,
               "Runtime": "oci",
               "ConsoleSize": [
                    0,
                    0
               ],
               "Isolation": "",
               "CpuShares": 0,
               "Memory": 0,
               "NanoCpus": 0,
               "CgroupParent": "user.slice/user-libpod_pod_f03fb97655412d3146208a315b66520e35d5739744431142a5dab1ef88925cbd.slice",
               "BlkioWeight": 0,
               "BlkioWeightDevice": null,
               "BlkioDeviceReadBps": null,
               "BlkioDeviceWriteBps": null,
               "BlkioDeviceReadIOps": null,
               "BlkioDeviceWriteIOps": null,
               "CpuPeriod": 0,
               "CpuQuota": 0,
               "CpuRealtimePeriod": 0,
               "CpuRealtimeRuntime": 0,
               "CpusetCpus": "",
               "CpusetMems": "",
               "Devices": [],
               "DiskQuota": 0,
               "KernelMemory": 0,
               "MemoryReservation": 0,
               "MemorySwap": 0,
               "MemorySwappiness": 0,
               "OomKillDisable": false,
               "PidsLimit": 2048,
               "Ulimits": [],
               "CpuCount": 0,
               "CpuPercent": 0,
               "IOMaximumIOps": 0,
               "IOMaximumBandwidth": 0,
               "CgroupConf": null
          }
     }
]

@daynyxx
Copy link
Author

daynyxx commented Mar 18, 2022

This is the result mounting a volume rather than a folder

$ )podman pod create --name pod-test -v pod-test:/test
36c848e9adbdc82a80e821037b2a5d09d7afddf084b1faf81fbd7c15af8b49ee
(kuroda@kuroda)-(~)
$ )podman run --pod pod-test --name=ls-container alpine ls -ld /test
drwxr-xr-x    2 root     root             6 Mar 18 15:21 /test
(kuroda@kuroda)-(~)
$ )podman inspect ls-container
[
     {
          "Id": "676622ae652731b7c26698faf523d3b861e77ea8c18b259ce108f169c22191f9",
          "Created": "2022-03-18T14:32:54.871472466-04:00",
          "Path": "ls",
          "Args": [
               "-ld",
               "/test"
          ],
          "State": {
               "OciVersion": "1.0.2-dev",
               "Status": "exited",
               "Running": false,
               "Paused": false,
               "Restarting": false,
               "OOMKilled": false,
               "Dead": false,
               "Pid": 0,
               "ExitCode": 0,
               "Error": "",
               "StartedAt": "2022-03-18T14:32:54.938554134-04:00",
               "FinishedAt": "2022-03-18T14:32:54.938994041-04:00",
               "Health": {
                    "Status": "",
                    "FailingStreak": 0,
                    "Log": null
               },
               "CheckpointedAt": "0001-01-01T00:00:00Z",
               "RestoredAt": "0001-01-01T00:00:00Z"
          },
          "Image": "e9adb5357e84d853cc3eb08cd4d3f9bd6cebdb8a67f0415cc884be7b0202416d",
          "ImageName": "docker.io/library/alpine:latest",
          "Rootfs": "",
          "Pod": "36c848e9adbdc82a80e821037b2a5d09d7afddf084b1faf81fbd7c15af8b49ee",
          "ResolvConfPath": "/run/user/1000/containers/overlay-containers/a35f8108e6011230450b0e2cd36d87dd799209192b1af2f9076c3d7f833551a6/userdata/resolv.conf",
          "HostnamePath": "/run/user/1000/containers/overlay-containers/676622ae652731b7c26698faf523d3b861e77ea8c18b259ce108f169c22191f9/userdata/hostname",
          "HostsPath": "/run/user/1000/containers/overlay-containers/a35f8108e6011230450b0e2cd36d87dd799209192b1af2f9076c3d7f833551a6/userdata/hosts",
          "StaticDir": "/home/kuroda/.local/share/containers/storage/overlay-containers/676622ae652731b7c26698faf523d3b861e77ea8c18b259ce108f169c22191f9/userdata",
          "OCIConfigPath": "/home/kuroda/.local/share/containers/storage/overlay-containers/676622ae652731b7c26698faf523d3b861e77ea8c18b259ce108f169c22191f9/userdata/config.json",
          "OCIRuntime": "crun",
          "ConmonPidFile": "/run/user/1000/containers/overlay-containers/676622ae652731b7c26698faf523d3b861e77ea8c18b259ce108f169c22191f9/userdata/conmon.pid",
          "PidFile": "/run/user/1000/containers/overlay-containers/676622ae652731b7c26698faf523d3b861e77ea8c18b259ce108f169c22191f9/userdata/pidfile",
          "Name": "ls-container",
          "RestartCount": 0,
          "Driver": "overlay",
          "MountLabel": "",
          "ProcessLabel": "",
          "AppArmorProfile": "",
          "EffectiveCaps": [
               "CAP_CHOWN",
               "CAP_DAC_OVERRIDE",
               "CAP_FOWNER",
               "CAP_FSETID",
               "CAP_KILL",
               "CAP_NET_BIND_SERVICE",
               "CAP_SETFCAP",
               "CAP_SETGID",
               "CAP_SETPCAP",
               "CAP_SETUID",
               "CAP_SYS_CHROOT"
          ],
          "BoundingCaps": [
               "CAP_CHOWN",
               "CAP_DAC_OVERRIDE",
               "CAP_FOWNER",
               "CAP_FSETID",
               "CAP_KILL",
               "CAP_NET_BIND_SERVICE",
               "CAP_SETFCAP",
               "CAP_SETGID",
               "CAP_SETPCAP",
               "CAP_SETUID",
               "CAP_SYS_CHROOT"
          ],
          "ExecIDs": [],
          "GraphDriver": {
               "Name": "overlay",
               "Data": {
                    "LowerDir": "/home/kuroda/.local/share/containers/storage/overlay/5e03d8cae8773cb694fff1d55da34a40d23c2349087ed15ce68476395d33753c/diff",
                    "UpperDir": "/home/kuroda/.local/share/containers/storage/overlay/cdfb70076da89e0f5e8bfb40244fd2b991b81bae05212942edc53c0a64cdfacf/diff",
                    "WorkDir": "/home/kuroda/.local/share/containers/storage/overlay/cdfb70076da89e0f5e8bfb40244fd2b991b81bae05212942edc53c0a64cdfacf/work"
               }
          },
          "Mounts": [
               {
                    "Type": "volume",
                    "Name": "pod-test",
                    "Source": "/home/kuroda/.local/share/containers/storage/volumes/pod-test/_data",
                    "Destination": "/test",
                    "Driver": "local",
                    "Mode": "",
                    "Options": [
                         "nosuid",
                         "nodev",
                         "rbind"
                    ],
                    "RW": true,
                    "Propagation": "rprivate"
               }
          ],
          "Dependencies": [
               "a35f8108e6011230450b0e2cd36d87dd799209192b1af2f9076c3d7f833551a6"
          ],
          "NetworkSettings": {
               "EndpointID": "",
               "Gateway": "",
               "IPAddress": "",
               "IPPrefixLen": 0,
               "IPv6Gateway": "",
               "GlobalIPv6Address": "",
               "GlobalIPv6PrefixLen": 0,
               "MacAddress": "",
               "Bridge": "",
               "SandboxID": "",
               "HairpinMode": false,
               "LinkLocalIPv6Address": "",
               "LinkLocalIPv6PrefixLen": 0,
               "Ports": {},
               "SandboxKey": "/run/user/1000/netns/netns-c299fda4-02a0-83fa-fc98-38dc9747edf4"
          },
          "Namespace": "",
          "IsInfra": false,
          "Config": {
               "Hostname": "676622ae6527",
               "Domainname": "",
               "User": "",
               "AttachStdin": false,
               "AttachStdout": false,
               "AttachStderr": false,
               "Tty": false,
               "OpenStdin": false,
               "StdinOnce": false,
               "Env": [
                    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                    "TERM=xterm",
                    "container=podman",
                    "HOME=/root",
                    "HOSTNAME=pod-test"
               ],
               "Cmd": [
                    "ls",
                    "-ld",
                    "/test"
               ],
               "Image": "docker.io/library/alpine:latest",
               "Volumes": null,
               "WorkingDir": "/",
               "Entrypoint": "",
               "OnBuild": null,
               "Labels": null,
               "Annotations": {
                    "io.container.manager": "libpod",
                    "io.kubernetes.cri-o.ContainerType": "container",
                    "io.kubernetes.cri-o.Created": "2022-03-18T14:32:54.871472466-04:00",
                    "io.kubernetes.cri-o.SandboxID": "pod-test",
                    "io.kubernetes.cri-o.TTY": "false",
                    "io.podman.annotations.autoremove": "FALSE",
                    "io.podman.annotations.init": "FALSE",
                    "io.podman.annotations.privileged": "FALSE",
                    "io.podman.annotations.publish-all": "FALSE",
                    "org.opencontainers.image.stopSignal": "15"
               },
               "StopSignal": 15,
               "CreateCommand": [
                    "podman",
                    "run",
                    "--pod",
                    "pod-test",
                    "--name=ls-container",
                    "alpine",
                    "ls",
                    "-ld",
                    "/test"
               ],
               "Umask": "0022",
               "Timeout": 0,
               "StopTimeout": 10,
               "Passwd": true
          },
          "HostConfig": {
               "Binds": [
                    "pod-test:/test:rw,rprivate,nosuid,nodev,rbind"
               ],
               "CgroupManager": "systemd",
               "CgroupMode": "private",
               "ContainerIDFile": "",
               "LogConfig": {
                    "Type": "journald",
                    "Config": null,
                    "Path": "",
                    "Tag": "",
                    "Size": "0B"
               },
               "NetworkMode": "container:a35f8108e6011230450b0e2cd36d87dd799209192b1af2f9076c3d7f833551a6",
               "PortBindings": {},
               "RestartPolicy": {
                    "Name": "",
                    "MaximumRetryCount": 0
               },
               "AutoRemove": false,
               "VolumeDriver": "",
               "VolumesFrom": null,
               "CapAdd": [],
               "CapDrop": [
                    "CAP_AUDIT_WRITE",
                    "CAP_MKNOD",
                    "CAP_NET_RAW"
               ],
               "Dns": [],
               "DnsOptions": [],
               "DnsSearch": [],
               "ExtraHosts": [],
               "GroupAdd": [],
               "IpcMode": "container:a35f8108e6011230450b0e2cd36d87dd799209192b1af2f9076c3d7f833551a6",
               "Cgroup": "",
               "Cgroups": "default",
               "Links": null,
               "OomScoreAdj": 0,
               "PidMode": "private",
               "Privileged": false,
               "PublishAllPorts": false,
               "ReadonlyRootfs": false,
               "SecurityOpt": [],
               "Tmpfs": {},
               "UTSMode": "container:a35f8108e6011230450b0e2cd36d87dd799209192b1af2f9076c3d7f833551a6",
               "UsernsMode": "",
               "ShmSize": 65536000,
               "Runtime": "oci",
               "ConsoleSize": [
                    0,
                    0
               ],
               "Isolation": "",
               "CpuShares": 0,
               "Memory": 0,
               "NanoCpus": 0,
               "CgroupParent": "user.slice/user-libpod_pod_36c848e9adbdc82a80e821037b2a5d09d7afddf084b1faf81fbd7c15af8b49ee.slice",
               "BlkioWeight": 0,
               "BlkioWeightDevice": null,
               "BlkioDeviceReadBps": null,
               "BlkioDeviceWriteBps": null,
               "BlkioDeviceReadIOps": null,
               "BlkioDeviceWriteIOps": null,
               "CpuPeriod": 0,
               "CpuQuota": 0,
               "CpuRealtimePeriod": 0,
               "CpuRealtimeRuntime": 0,
               "CpusetCpus": "",
               "CpusetMems": "",
               "Devices": [],
               "DiskQuota": 0,
               "KernelMemory": 0,
               "MemoryReservation": 0,
               "MemorySwap": 0,
               "MemorySwappiness": 0,
               "OomKillDisable": false,
               "PidsLimit": 2048,
               "Ulimits": [],
               "CpuCount": 0,
               "CpuPercent": 0,
               "IOMaximumIOps": 0,
               "IOMaximumBandwidth": 0,
               "CgroupConf": null
          }
     }
]

@mheon
Copy link
Member

mheon commented Mar 18, 2022

"Mounts": [],

Mounts are definitely unset for that container, so Podman did not add the mount.

@mheon
Copy link
Member

mheon commented Mar 18, 2022

Any chance you can do a podman inspect of the infra container of the pod that has the volume mount and provide that?

@daynyxx
Copy link
Author

daynyxx commented Mar 18, 2022

$ )podman inspect -t=pod pod-test
[
     {
          "Id": "8622f28f5638b2790711fe871de615e0d0c5d8b7e1aef44cc1ba708e076677d2",
          "Name": "pod-test",
          "Created": "2022-03-18T14:56:02.491073597-04:00",
          "CreateCommand": [
               "podman",
               "pod",
               "create",
               "--name",
               "pod-test",
               "-v",
               "/home/kuroda/test-folder:/test"
          ],
          "State": "Degraded",
          "Hostname": "",
          "CreateCgroup": true,
          "CgroupParent": "user.slice",
          "CgroupPath": "user.slice/user-libpod_pod_8622f28f5638b2790711fe871de615e0d0c5d8b7e1aef44cc1ba708e076677d2.slice",
          "CreateInfra": true,
          "InfraContainerID": "13c438296c37774fce1dad195440060dbda924eba96daf7d1d3284390237ca67",
          "InfraConfig": {
               "PortBindings": {},
               "HostNetwork": true,
               "StaticIP": "",
               "StaticMAC": "",
               "NoManageResolvConf": false,
               "DNSServer": null,
               "DNSSearch": null,
               "DNSOption": null,
               "NoManageHosts": false,
               "HostAdd": null,
               "Networks": null,
               "NetworkOptions": null,
               "pid_ns": "private",
               "userns": "host"
          },
          "SharedNamespaces": [
               "uts",
               "ipc",
               "net"
          ],
          "NumContainers": 2,
          "Containers": [
               {
                    "Id": "13c438296c37774fce1dad195440060dbda924eba96daf7d1d3284390237ca67",
                    "Name": "8622f28f5638-infra",
                    "State": "running"
               },
               {
                    "Id": "3ce49f7a000b05c77041f1fac2fe2f69a12c917ed4c10dff1cabeed06d99a751",
                    "Name": "ls-container",
                    "State": "exited"
               }
          ],
          "mounts": [
               {
                    "Type": "bind",
                    "Source": "/home/kuroda/test-folder",
                    "Destination": "/test",
                    "Driver": "",
                    "Mode": "",
                    "Options": [
                         "rbind"
                    ],
                    "RW": true,
                    "Propagation": "rprivate"
               }
          ]
     }
]

cdoern pushed a commit to cdoern/podman that referenced this issue Mar 29, 2022
the infra Inherit function was not properly passing pod volume information to new containers
alter the inherit function and struct to use the new `ConfigToSpec` function used in clone
pick and choose the proper entities from a temp spec and validate them on the spegen side rather
than passing directly to a config

resolves containers#13548

Signed-off-by: cdoern <[email protected]>
Signed-off-by: cdoern <[email protected]>
Signed-off-by: cdoern <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants