Skip to content

fix: upgrade docker/docker to moby - #348

Open
bwplotka wants to merge 1 commit into
release-2.53.5-gmpfrom
fix-2.53.5-gmp-docker
Open

fix: upgrade docker/docker to moby#348
bwplotka wants to merge 1 commit into
release-2.53.5-gmpfrom
fix-2.53.5-gmp-docker

Conversation

@bwplotka

@bwplotka bwplotka commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

This fixes b/524928356

This fixes b/524928356

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the Docker and Docker Swarm service discovery implementations from the deprecated github.com/docker/docker client to the github.com/moby/moby client. However, several critical compilation errors were identified where string fields (such as IP addresses and CIDR blocks) are treated as netip.Addr or have .Addr() called directly on them. The feedback suggests refactoring ipString to parse string addresses, using netip.ParsePrefix to handle CIDR strings, and adding the missing "net/netip" imports.

Comment thread discovery/moby/docker.go
Comment thread discovery/moby/services.go
Comment thread discovery/moby/tasks.go
Comment thread discovery/moby/services.go
Comment thread discovery/moby/tasks.go
@bwplotka
bwplotka marked this pull request as ready for review August 4, 2026 13:14
if err != nil {
return nil, fmt.Errorf("error while parsing address %s: %w", p.Addr, err)
}
ip := p.Addr.Addr().String()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Calling .String() directly on an unassigned or zero-value netip.Addr evaluates to the literal string "invalid IP", which could corrupt target addresses. Since you added ipString() in docker.go, we should use it here as well to safely return an empty string.

Suggested change
ip := p.Addr.Addr().String()
ip := ipString(p.Addr.Addr())

Comment thread discovery/moby/tasks.go
if err != nil {
return nil, fmt.Errorf("error while parsing address %s: %w", address, err)
}
ip := address.Addr().String()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Similar to services.go, calling .String() directly on a zero-value netip.Addr returns "invalid IP". We should wrap this in ipString() to keep address formatting safe.

Suggested change
ip := address.Addr().String()
ip := ipString(address.Addr())

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