-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add default net info in container inspect #9092
Conversation
when inspecting a container that is only connected to the default network, we should populate the default network in the container inspect information. Fixes: containers#6618 Signed-off-by: baude <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: baude The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LGTM |
cniNet := new(define.InspectAdditionalNetwork) | ||
cniNet.NetworkID = c.runtime.netPlugin.GetDefaultNetworkName() | ||
settings.Networks[c.runtime.netPlugin.GetDefaultNetworkName()] = cniNet | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block is still unnecessary, though. All your work here is undone by the if len(networks) > 0
block below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also are going to need to modify the other use of !isDefault
(L958) - the one that handles non-running containers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should talk about that ... look at the block just beneath this. it looks there is step prior where the map is setup. lets discuss in watercooler.
@@ -443,4 +443,16 @@ var _ = Describe("Podman inspect", func() { | |||
Expect(inspect.OutputToString()).To(Equal(`"{"80/tcp":[{"HostIp":"","HostPort":"8080"}]}"`)) | |||
}) | |||
|
|||
It("Verify container inspect has default network", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add another test with a container that is not running.
Taking this over - #9109 |
when inspecting a container that is only connected to the default
network, we should populate the default network in the container inspect
information.
Fixes: #6618
Signed-off-by: baude [email protected]