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

discrepancy in podman network inspect for netmask (compat API) #14674

Closed
idleroamer opened this issue Jun 21, 2022 · 0 comments
Closed

discrepancy in podman network inspect for netmask (compat API) #14674

idleroamer opened this issue Jun 21, 2022 · 0 comments
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

@idleroamer
Copy link
Contributor

idleroamer commented Jun 21, 2022

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

/kind bug

Description

podman main: The netmask of secondaryIPAddresses/SecondaryIPv6Addresses in container network inspect compat API is always zero.

podman v3: Wrong type used for secondaryIPAddresses/SecondaryIPv6Addresses (string instead of network.Address) results in broken
container inspect compat API in presence of secondary network interfaces.

Steps to reproduce the issue:
Reproduction in main branch

  1. create a named network namespace and setup two veth interface
ip netns add test
ip netns exec test /bin/bash
ip link add enp2s0 type veth peer name eth0
ip addr add 10.0.1.0/24 dev eth0
ip link set eth0 up
ip link add enp2s1 type veth peer name eth1
ip addr add 10.0.2.0/24 dev eth1
ip link set eth1 up
exit

  1. run a container and join the created network namespace
podman run --net ns:/run/netns/test --name test -it alpine /bin/sh
  1. start a podman service
podman system service tcp:localhost:20000 --log-level=debug --time=0
  1. Check output of podman inspect test
 curl -X GET 'http://127.0.0.1:20000/v3.0.0/containers/test/json'| jq

Describe the results you received:
PrefixLen is 0

"NetworkSettings": {
    "Bridge": "",
    "SandboxID": "",
    "HairpinMode": false,
    "LinkLocalIPv6Address": "",
    "LinkLocalIPv6PrefixLen": 0,
    "Ports": {},
    "SandboxKey": "",
    "SecondaryIPAddresses": [
      {
        "Addr": "10.0.2.0",
        "PrefixLen": 0
      }

Describe the results you expected:
PrefixLen should be 24

Output of podman version:

podman version 4.0.0-dev

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.24.1
  cgroupControllers:
  - cpuset
  - cpu
  - cpuacct
  - blkio
  - memory
  - devices
  - freezer
  - net_cls
  - perf_event
  - net_prio
  - pids
  cgroupManager: systemd
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.27+git0+3efab3e71c-r0.core2_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.28-dev, commit: 3efab3e71c4c29f127cd7b8e8a5a885fc17dec88'
  cpus: 6
  distribution:
    distribution: mbient
    version: "1.0"
  eventLogger: journald
  hostname: qemux86-64
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.10.30-yocto-standard
  linkmode: dynamic
  logDriver: journald
  memFree: 7883513856
  memTotal: 22187085824
  networkBackend: cni
  ociRuntime:
    name: crun
    package: crun-0.18+gitf302dd8c02c6fddd2c50d1685d82b7a19aae8afe-r0.core2_64
    path: /usr/bin/crun
    version: |-
      crun version 0.19.5-f302-dirty
      commit: f302dd8c02c6fddd2c50d1685d82b7a19aae8afe
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: true
    capabilities: CAP_AUDIT_WRITE,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_MKNOD,CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: ""
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-0.4.1-r0.core2_64
    version: |-
      slirp4netns version 0.4.1
      commit: unknown
  swapFree: 46133248
  swapTotal: 46133248
  uptime: 6h 6m 42.11s (Approximately 0.25 days)
plugins:
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 6
    paused: 0
    running: 3
    stopped: 3
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev
  graphRoot: /mnt/systemdata/dynamic-contents/podman
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 2
  runRoot: /var/run/containers/storage
  volumePath: /mnt/systemdata/dynamic-contents/podman/volumes
version:
  APIVersion: 4.0.0-dev
  Built: 1655756421
  BuiltTime: Mon Jun 20 22:20:21 2022
  GitCommit: 192dea7d981443a8091596eb91e6c4274b8a6f85
  GoVersion: go1.18.3
  OsArch: linux/amd64
  Version: 4.0.0-dev

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

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 21, 2022
idleroamer added a commit to idleroamer/podman that referenced this issue Jun 21, 2022
Fix type mismatch of SecondaryIPAddresses in network inspect

Closes: containers#14674
Signed-off-by: 🤓 Mostafa Emami <[email protected]>
@openshift-ci openshift-ci bot closed this as completed in ee05bc0 Jul 7, 2022
@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

No branches or pull requests

2 participants