Commit d7f977d
authored
Work around tox-docker KeyError on Docker 29+ (#3045)
## Description
Added `TOX_DOCKER_GATEWAY` environment variable to the test workflow to
work around a `KeyError: 'Gateway'` failure in tox-docker when running
on Docker 29+.
Docker 29 [removed the deprecated top-level `NetworkSettings.Gateway`
key](https://docs.docker.com/engine/release-notes/29/) from the
container inspect API. tox-docker 5.0.0 relies on this key and crashes
with a `KeyError`. Setting `TOX_DOCKER_GATEWAY=0.0.0.0` bypasses the
broken lookup entirely.
This became flaky starting Feb 12 as the [Docker 29
rollout](actions/runner-images#13474) to
GitHub Actions runners progresses. Once complete, tests will fail 100%
of the time without this fix.
This workaround can be removed once [tox-docker merges the
fix](tox-dev/tox-docker#196).
Mirrors the fix applied in
[library-registry#862](ThePalaceProject/library-registry#862).
## Motivation and Context
CI test runs are failing intermittently with:
```
tox_docker/plugin.py, line 53, in get_gateway_ip
ip = container.attrs["NetworkSettings"]["Gateway"] or "0.0.0.0"
KeyError: 'Gateway'
```
## How Has This Been Tested?
- CI will validate that tests pass with the workaround on Docker 29+
runners
## Checklist
- [x] I have updated the documentation accordingly.
- [x] All new and existing tests passed.1 parent 0862033 commit d7f977d
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
0 commit comments