Skip to content

Conversation

@thaJeztah
Copy link
Contributor

No description provided.

Comment on lines 239 to 253
c := ctnr
if networkMode.IsContainer() {
containerID := networkMode.ConnectedContainer()
res, err := client.ContainerInspect(context.Background(), containerID, dclient.ContainerInspectOptions{})
if err != nil {
return nil, fmt.Errorf("failed to inspect container %q: %v", id, err)
}
ipAddress = c.NetworkSettings.IPAddress
c = res.Container
}
for n, nw := range c.NetworkSettings.Networks {
if n == c.HostConfig.NetworkMode.NetworkName() {
if nw.IPAddress.IsValid() {
handler.ipAddress = nw.IPAddress.String()
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @robmry perhaps you could have a peek if this is the correct approach for the IP-address

@thaJeztah
Copy link
Contributor Author

cc @dims if you can give CI a kick to have it run 😅

dockerClient, dockerClientErr = dclient.New(
dclient.WithHost(*ArgDockerEndpoint),
dclient.WithHTTPClient(client),
dclient.WithAPIVersionNegotiation())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now enabled by default

@dims
Copy link
Collaborator

dims commented Dec 4, 2025

cc @dims if you can give CI a kick to have it run 😅

Done!

@thaJeztah
Copy link
Contributor Author

Ah, thanks! And looks like I missed some change somewhere; let me have a look 👍

@thaJeztah thaJeztah force-pushed the switch_moby_modules branch from f0de6b6 to 632e89a Compare December 4, 2025 17:25
@thaJeztah thaJeztah force-pushed the switch_moby_modules branch 2 times, most recently from 38f7d98 to 2442160 Compare December 4, 2025 22:12
The top-level IPAddress field is deprecated in the API, so instead,
the IP-address should be obtained from the container's primary network.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants