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

The basic network config is not updated on non-default network #10232

Closed
afbjorklund opened this issue May 5, 2021 · 3 comments
Closed

The basic network config is not updated on non-default network #10232

afbjorklund opened this issue May 5, 2021 · 3 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

@afbjorklund
Copy link
Contributor

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

/kind bug

Description

When using a custom network, instead of the default "podman" network, the basic info is empty.

Steps to reproduce the issue:

  1. sudo podman network create test

  2. sudo podman run --network test -d busybox sleep 3600

  3. sudo podman container inspect <id_from_previous>

Originally seen in kubernetes/minikube#11293

Describe the results you received:

        "NetworkSettings": {
            "EndpointID": "",
            "Gateway": "",
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "MacAddress": "",
            "Bridge": "",
            "SandboxID": "",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/run/netns/cni-a96b5a52-8393-70da-b0e5-54ec25cd0708",
            "Networks": {
                "test": {
                    "EndpointID": "",
                    "Gateway": "10.89.0.1",
                    "IPAddress": "10.89.0.2",
                    "IPPrefixLen": 24,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "7e:5c:18:be:67:c9",
                    "NetworkID": "test",
                    "DriverOpts": null,
                    "IPAMConfig": null,
                    "Links": null
                }
            }
        },

Describe the results you expected:

        "NetworkSettings": {
            "EndpointID": "",
            "Gateway": "10.89.0.1",
            "IPAddress": "10.89.0.2",
            "IPPrefixLen": 24,
            "IPv6Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "MacAddress": "7e:5c:18:be:67:c9",
            "Bridge": "",
            "SandboxID": "",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/run/netns/cni-a96b5a52-8393-70da-b0e5-54ec25cd0708",
            "Networks": {
                "test": {
                    "EndpointID": "",
                    "Gateway": "10.89.0.1",
                    "IPAddress": "10.89.0.2",
                    "IPPrefixLen": 24,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "7e:5c:18:be:67:c9",
                    "NetworkID": "test",
                    "DriverOpts": null,
                    "IPAMConfig": null,
                    "Links": null
                }
            }
        },

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

There seems to be a line missing, when not using the default network.

                settings.InspectBasicNetworkConfig = basicConfig

Output of podman version:

Version:      3.1.2
API Version:  3.1.2
Go Version:   go1.15.2
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

Output of podman info --debug:

(paste your output here)

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

podman/unknown,now 100:3.1.2-1 amd64 [installed]

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

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

Physical Ubuntu

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 5, 2021
@Luap99
Copy link
Member

Luap99 commented May 5, 2021

I think this was done intentionally because docker does the same. @mheon Do you remember?

@afbjorklund
Copy link
Contributor Author

I think this was done intentionally because docker does the same.

That seems to be true, unfortunately it was on a different code path...

        if ociBin == Docker {
                return dockerNetworkInspect(name)
        }
        if ociBin == Podman {
                return podmanNetworkInspect(name)
        }

We will change our code to use the docker version (with Networks).

The version for podman worked, before we added private networks...

@mheon
Copy link
Member

mheon commented May 6, 2021

@Luap99 is correct, this is for Docker compat - but I should verify that it's actually what Docker does, it's been a while since I had a proper look at that.

@mheon mheon self-assigned this May 6, 2021
@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

No branches or pull requests

4 participants