-
Notifications
You must be signed in to change notification settings - Fork 18.9k
fix "host-gateway-ip" label not set for builder workers #47187
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
Conversation
933aa73 to
53fabba
Compare
53fabba to
7a29763
Compare
Commit 21e50b8 added a label on the buildkit worker to advertise the host-gateway-ip. This option can be either set by the user in the daemon config, or otherwise defaults to the gateway-ip. If no value is set by the user, discovery of the gateway-ip happens when initializing the network-controller (`NewDaemon`, `daemon.restore()`). However d222bf0 changed how we handle the daemon config. As a result, the `cli.Config` used when initializing the builder only holds configuration information form the daemon config (user-specified or defaults), but is not updated with information set by `NewDaemon`. This patch adds an accessor on the daemon to get the current daemon config. An alternative could be to return the config by `NewDaemon` (which should likely be a _copy_ of the config). Before this patch: docker buildx inspect default Name: default Driver: docker Nodes: Name: default Endpoint: default Status: running Buildkit: v0.12.4+3b6880d2a00f Platforms: linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6 Labels: org.mobyproject.buildkit.worker.moby.host-gateway-ip: <nil> After this patch: docker buildx inspect default Name: default Driver: docker Nodes: Name: default Endpoint: default Status: running Buildkit: v0.12.4+3b6880d2a00f Platforms: linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6 Labels: org.mobyproject.buildkit.worker.moby.host-gateway-ip: 172.18.0.1 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
7a29763 to
00c9785
Compare
| // Config returns daemon's config. | ||
| func (daemon *Daemon) Config() config.Config { |
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.
FWIW, not "stoked" by this solution, but it should get us going.
|
Failure is unrelated; and tracked in #47119 |
|
New failure is also unrelated (other flaky test); #46508 |
laurazard
left a comment
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.
LGTM (but yeah, this is a messy area and we should track this somewhere to improve)
|
@laurazard yeah, agreed. I did an ever-so-slightly cleanup after I worked on this here; #47188 (nothing for the "global picture" though. |
Commit 21e50b8 added a label on the buildkit worker to advertise the host-gateway-ip. This option can be either set by the user in the daemon config, or otherwise defaults to the gateway-ip.
If no value is set by the user, discovery of the gateway-ip happens when initializing the network-controller (
NewDaemon,daemon.restore()).However d222bf0 changed how we handle the daemon config. As a result, the
cli.Configused when initializing the builder only holds configuration information form the daemon config (user-specified or defaults), but is not updated with information set byNewDaemon.This patch adds an accessor on the daemon to get the current daemon config. An alternative could be to return the config by
NewDaemon(which should likely be a copy of the config).Before this patch:
After this patch:
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)