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

network create no longer creates a gateway by default #8748

Closed
ondrejbudai opened this issue Dec 16, 2020 · 2 comments · Fixed by #8756
Closed

network create no longer creates a gateway by default #8748

ondrejbudai opened this issue Dec 16, 2020 · 2 comments · Fixed by #8756
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

@ondrejbudai
Copy link

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

/kind bug

Description

podman network create used to create a default gateway if it wasn't provided. This behavior was removed in 2.2.0, see this diff: e7a72d7#diff-1203e6d536d51fdb4f55e4a605d74cc02986bb5b934027f576dbf8faf91ff6b9L66-L69

Steps to reproduce the issue:

  1. podman network create test

  2. podman inspect test

Describe the results you received:

[
    {
...
        "plugins": [
            {
                "bridge": "cni-podman1",
                "hairpinMode": true,
                "ipMasq": true,
                "ipam": {
                    "ranges": [
                        [
                            {
                                "subnet": "10.89.0.0/24"
                            }
                        ]
                    ],
...
]

Describe the results you expected:

[
    {
...
        "plugins": [
            {
                "bridge": "cni-podman1",
                "hairpinMode": true,
                "ipMasq": true,
                "ipam": {
                    "ranges": [
                        [
                            {
                                "subnet": "10.89.0.0/24",
                                "gateway": "10.89.0.1"
                            }
                        ]
                    ],
...
]

Output of podman version:

Version:      2.2.1
API Version:  2.1.0
Go Version:   go1.15.5
Built:        Tue Dec  8 15:37:50 2020
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.18.0
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.21-3.fc33.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.21, commit: 0f53fb68333bdead5fe4dc5175703e22cf9882ab'
  cpus: 8
  distribution:
    distribution: fedora
    version: "33"
  eventLogger: journald
  hostname: localhost.localdomain
  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.9.13-200.fc33.x86_64
  linkmode: dynamic
  memFree: 500396032
  memTotal: 16650522624
  ociRuntime:
    name: crun
    package: crun-0.16-1.fc33.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.16
      commit: eb0145e5ad4d8207e84a327248af76663d4e50dd
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  rootless: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.8-1.fc33.x86_64
    version: |-
      slirp4netns version 1.1.8
      commit: d361001f495417b880f20329121e3aa431a8f90f
      libslirp: 4.3.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.0
  swapFree: 3139600384
  swapTotal: 4294963200
  uptime: 94h 34m 13.45s (Approximately 3.92 days)
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - docker.io
store:
  configFile: /home/obudai/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-1.3.0-1.fc33.x86_64
      Version: |-
        fusermount3 version: 3.9.3
        fuse-overlayfs: version 1.3
        FUSE library version 3.9.3
        using FUSE kernel interface version 7.31
  graphRoot: /home/obudai/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 12
  runRoot: /run/user/1000/containers
  volumePath: /home/obudai/.local/share/containers/storage/volumes
version:
  APIVersion: 2.1.0
  Built: 1607438270
  BuiltTime: Tue Dec  8 15:37:50 2020
  GitCommit: ""
  GoVersion: go1.15.5
  OsArch: linux/amd64
  Version: 2.2.1

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

podman-2.2.1-1.fc33.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Dec 16, 2020
ondrejbudai added a commit to ondrejbudai/koji-osbuild that referenced this issue Dec 16, 2020
Podman 2.2.0 doesn't create a gateway by default. See:
containers/podman#8748

This commits introduces a workaround: specifying the gateway manually.

Note that the gateway is used in test/run-builder.sh
ondrejbudai added a commit to osbuild/koji-osbuild that referenced this issue Dec 16, 2020
Podman 2.2.0 doesn't create a gateway by default. See:
containers/podman#8748

This commits introduces a workaround: specifying the gateway manually.

Note that the gateway is used in test/run-builder.sh
@mheon
Copy link
Member

mheon commented Dec 16, 2020

Eeek. This one's pretty bad. @rhatdan @baude I think this one needs to be investigated and fixed for the RHEL 2.2.1 branch.

@baude
Copy link
Member

baude commented Dec 16, 2020

based on the author's comments, it isnt needed:

https://github.com/containers/podman/blob/master/libpod/network/create.go#L156

@Luap99 Luap99 self-assigned this Dec 16, 2020
Luap99 pushed a commit to Luap99/libpod that referenced this issue Dec 16, 2020
`podman network create` should always add a gateway to the cni config.
If no gateway is given use the first ip in the subnet. CNI does not require
the gateway field but we need it because of network inspect.

This worked with previous version but was dropped in Commit(e7a72d7).

Fixes containers#8748

Signed-off-by: Paul Holzinger <[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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 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.

5 participants