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

Add default net info in container inspect #9092

Closed
wants to merge 1 commit into from

Conversation

baude
Copy link
Member

@baude baude commented Jan 25, 2021

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]

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]>
@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 25, 2021
@rhatdan
Copy link
Member

rhatdan commented Jan 25, 2021

LGTM

cniNet := new(define.InspectAdditionalNetwork)
cniNet.NetworkID = c.runtime.netPlugin.GetDefaultNetworkName()
settings.Networks[c.runtime.netPlugin.GetDefaultNetworkName()] = cniNet
}
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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() {
Copy link
Member

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.

@mheon mheon mentioned this pull request Jan 26, 2021
@mheon
Copy link
Member

mheon commented Jan 26, 2021

Taking this over - #9109

@mheon mheon closed this Jan 26, 2021
@baude baude deleted the issue6618 branch May 18, 2022 15:18
@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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 this pull request may close these issues.

inspect command: Populate Bridge field in network settings
4 participants