Skip to content

Generated container Quadlets not referencing correct pod anymore #26105

@gxtu

Description

@gxtu

Issue Description

When generating systemd units from container Quadlets it now uses the container name instead of the pod name for the --pod parameter by default. This causes container Quadlets referencing Pod Quadlets without a custom name to not work, because the generated Pod name is wrong.

It looks like this might be the relevant change.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Create a mypod.pod Quadlet containing [Pod]
  2. Create a mycontainer.container Quadlet referencing the above mypod.pod Quadlet.
  3. Generate the systemd units

Describe the results you received

The generated systemd container unit includes the parameter --pod systemd-mycontainer, making the container unable to start, because the name for the generated pod is systemd-mypod-pod.

Describe the results you expected

The generated systemd container unit includes the parameter --pod systemd-mypod-pod, referencing the name of the systemd pod unit generated from mypod.pod.

podman info output

host:
  arch: amd64
  buildahVersion: 1.40.0
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  - rdma
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.12-1.el9.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.12, commit: eb379dceb7efebd9a9d6b3349a57424d83483065'
  cpuUtilization:
    idlePercent: 96.44
    systemPercent: 1.24
    userPercent: 2.31
  cpus: 4
  databaseBackend: sqlite
  distribution:
    distribution: almalinux
    version: "9.5"
  eventLogger: journald
  freeLocks: 2030
  hostname: server
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.14.0-503.40.1.el9_5.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 2454065152
  memTotal: 7858102272
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.14.0-1.20250506124649452608.main.62.geefe7fa.el9.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.15.0-dev
    package: netavark-1.14.0-1.20250507172215686453.main.115.gd062d14.el9.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.15.0-dev
  ociRuntime:
    name: crun
    package: crun-1.21-1.20250508212401762497.main.91.g16b7ae4f.el9.x86_64
    path: /usr/bin/crun
    version: |-
      crun version UNKNOWN
      commit: b8a6a80b5a4f2208d668438ded1c16faf107765f
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /bin/pasta
    package: passt-0^20240806.gee36266-7.el9_5.x86_64
    version: |
      pasta 0^20240806.gee36266-7.el9_5.x86_64
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  rootlessNetworkCmd: pasta
  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: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /bin/slirp4netns
    package: slirp4netns-1.3.1-1.el9.x86_64
    version: |-
      slirp4netns version 1.3.1
      commit: e5e368c4f5db6ae75c2fce786e31eef9da6bf236
      libslirp: 4.4.0
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.2
  swapFree: 0
  swapTotal: 0
  uptime: 0h 32m 43.00s
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.access.redhat.com
  - registry.redhat.io
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 5
    paused: 0
    running: 4
    stopped: 1
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 161123659776
  graphRootUsed: 11774300160
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 16
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 5.6.0-dev
  BuildOrigin: 'Copr: rhcontainerbot/podman-next'
  Built: 1746748800
  BuiltTime: Fri May  9 02:00:00 2025
  GitCommit: 811aabd3b0300ab9f03e3d733facb77f29a53747
  GoVersion: go1.23.6 (Red Hat 1.23.6-2.el9_5)
  Os: linux
  OsArch: linux/amd64
  Version: 5.6.0-dev

Podman in a container

No

Privileged Or Rootless

Privileged

Upstream Latest Release

Yes

Additional environment details

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.quadlettriagedIssue has been triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions