Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Cannot get network info from container when using hyphens in network name #22448

Closed
oSourceSE opened this issue Apr 20, 2024 · 0 comments
Closed

Comments

@oSourceSE
Copy link

Issue Description

Hi

i run podman 4.3.1 on Ubuntu and created network names with hypens in them like this: net-containername-local

Everything will run fine but when trying to filter out the network settings with inspect i get the following error.

Error: template: inspect:1: bad character U+002D '-'

If i recreate the network to either not use hyphens or to use underscores it works.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Create network with hyphens:
    podman network create net-mycontainer-local
  2. Create container with attached network:
    podman container create --network net-mycontainer-local mycontainer someimage
  3. Start the container:
    podman container start mycontainer
  4. run podman inspect to get container ip:
    podman container inspect --format '{{.NetworkSettings.Networks.net-mycontainer-local.IPAddress}}' mycontainer

Describe the results you received

An error complaining about hyphens instead of the network name.

Error: template: inspect:1: bad character U+002D '-'

Describe the results you expected

Information about the specificed network tag, in this case the ip of the container.

podman info output

host:
  arch: amd64
  buildahVersion: 1.28.2
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon_2.1.6+ds1-1_amd64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.6, commit: unknown'
  cpuUtilization:
    idlePercent: 99.73
    systemPercent: 0.15
    userPercent: 0.12
  cpus: 1
  distribution:
    codename: mantic
    distribution: ubuntu
    version: "23.10"
  eventLogger: journald
  hostname: pmt01
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1002
      size: 1
    - container_id: 1
      host_id: 100000
      size: 10000000
    uidmap:
    - container_id: 0
      host_id: 1002
      size: 1
    - container_id: 1
      host_id: 100000
      size: 10000000
  kernel: 6.5.0-27-generic
  linkmode: dynamic
  logDriver: journald
  memFree: 93487104
  memTotal: 2053988352
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun_1.8.5-1_amd64
    path: /usr/bin/crun
    version: |-
      crun version 1.8.5
      commit: b6f80f766c9a89eb7b1440c0a70ab287434b17ed
      rundir: /run/user/***/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +WASM:wasmedge +YAJL
  os: linux
  remoteSocket:
    path: /run/user/***/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.2.0-1_amd64
    version: |-
      slirp4netns version 1.2.0
      commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.4
  swapFree: 2146156544
  swapTotal: 2147479552
  uptime: 62h 10m 19.00s (Approximately 2.58 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /***/.config/containers/storage.conf
  containerStore:
    number: 22
    paused: 0
    running: 22
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /***/cstorage
  graphRootAllocated: 15740116992
  graphRootUsed: 11847131136
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 8
  runRoot: /run/user/***/containers
  volumePath: /***/volumes
version:
  APIVersion: 4.3.1
  Built: 0
  BuiltTime: Thu Jan  1 00:00:00 1970
  GitCommit: ""
  GoVersion: go1.21.1
  Os: linux
  OsArch: linux/amd64

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@oSourceSE oSourceSE added the kind/bug Categorizes issue or PR as related to a bug. label Apr 20, 2024
@Luap99 Luap99 removed the kind/bug Categorizes issue or PR as related to a bug. label Apr 20, 2024
@containers containers locked and limited conversation to collaborators Apr 20, 2024
@Luap99 Luap99 converted this issue into discussion #22449 Apr 20, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants