Skip to content

fix(provision/docker): set HostIP on PortBindings to bind on host#15

Merged
solsson merged 1 commit into
mainfrom
fix-docker-portbindings-hostip
May 2, 2026
Merged

fix(provision/docker): set HostIP on PortBindings to bind on host#15
solsson merged 1 commit into
mainfrom
fix-docker-portbindings-hostip

Conversation

@solsson
Copy link
Copy Markdown
Contributor

@solsson solsson commented May 2, 2026

an attempt to fix actions' e2e-cluster

The docker provider's buildHostConfig built every PortBinding with
HostIP left as the netip.Addr zero value (`invalid IP`). moby
v1.54.x marshals an invalid Addr as the empty JSON string, and
Docker Engine 28 (ubuntu-latest) silently drops bindings whose
HostIp comes through empty: the container starts, but
NetworkSettings.Ports is `{}` and nothing is published to the host.

Surfaced through Yolean/ystack PR 76, where the local-docker
acceptance config maps four ports (6443/80/443/8944). The single-
forward y-cluster e2e on the same runner happens to escape the
behaviour but it was always a race -- on Docker Desktop the
daemon picked 127.0.0.1 to fill the empty HostIp; on Docker
Engine it left the binding off entirely.

Setting HostIP to netip.IPv4Unspecified() ("0.0.0.0") matches
the semantics of `docker run -p host:guest` (Docker Engine binds
on every interface) and produces a valid Addr that survives the
v1.54.x JSON round-trip.

Regression test asserts every binding produced by buildHostConfig
carries a valid HostIP.

Verified locally with TestDocker_ProvisionTeardown still passing
(host port 36443) and the four-port reproducer (6443/80/443/8944)
publishing all four bindings on Docker Desktop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@solsson solsson merged commit ffbab43 into main May 2, 2026
11 checks passed
solsson added a commit to Yolean/ystack that referenced this pull request May 3, 2026
Two y-cluster releases unblock the docker provider on
ubuntu-latest and let the acceptance script collapse to a single
provision call:

- v0.3.5 (Yolean/y-cluster#12) added a host-side /readyz probe
  between the in-container kubeconfig appearing and "k3s ready"
  being declared, closing the docker port-forward race that made
  envoy-gateway install fail with "dial tcp 127.0.0.1:6443:
  connect: connection refused". The 4x retry/sleep-10s
  workaround in this script is dead code now -- each retry tore
  the cluster down and reproduced the deterministic race anyway.
- v0.3.6 (Yolean/y-cluster#15) fixed a separate silent-drop in
  the docker provider's PortBindings: HostIP was left as the
  zero netip.Addr ("invalid IP"), which moby v1.54+ marshals to
  the empty JSON string and Docker Engine 28 dropped silently.

  A second issue with PortBindings still surfaces in some CI
  contexts -- the y-cluster-managed container's
  NetworkSettings.Ports comes back empty even with v0.3.6 -- but
  it's distinct from anything this script can work around;
  filed upstream against y-cluster.

The y-kustomize Deployment image is bumped to the matching
v0.3.6 tag for consistency.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant