-
Notifications
You must be signed in to change notification settings - Fork 2.4k
docker: migrate to github.com/moby/moby modules #3757
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
base: master
Are you sure you want to change the base?
Conversation
container/docker/handler.go
Outdated
| 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() | ||
| } | ||
| } |
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.
cc @robmry perhaps you could have a peek if this is the correct approach for the IP-address
|
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()) |
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 is now enabled by default
70c045c to
f0de6b6
Compare
Done! |
|
Ah, thanks! And looks like I missed some change somewhere; let me have a look 👍 |
f0de6b6 to
632e89a
Compare
38f7d98 to
2442160
Compare
full diff: docker/go-connections@v0.5.0...v0.6.0 Signed-off-by: Sebastiaan van Stijn <[email protected]>
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]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
2442160 to
cfbcb5d
Compare
No description provided.