Repository navigation
fix(docker): treat only reference-specific errors as missing networks - #35
Merged
Merged
Conversation
isMissingNetwork matched any Docker output containing "not found". When the selected Docker context is unavailable, the CLI prints `context "x": context not found`, and that was misread as a missing network. docker_network_absent then passed while the network still existed, and Close dropped the network from its retryable cleanup set, so every lab network leaked once the context recovered. A network now counts as missing only when Docker names the exact reference: "network <ref> not found" (current engines) or "No such network: <ref>" (older engines). Every caller passes its exact reference (inspect, Close, and the orphan janitor), so context, transport, and CLI failures now propagate as errors. Regression tests cover: - classification against messages captured from Docker 29.7.2; - context failure and recovery, for both validation and Close; - the janitor's network removal path. All three fail against the old substring match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Aleksandergreg
added a commit
that referenced
this pull request
Sep 30, 2026
Main gained the squash-merged fix from #35 (1fa140c), which is identical to this branch's fix commit (9a760c2). Both sides touched the files the refactor later moved, so the three conflicts keep this branch's side: - dockerlab_test.go stays deleted. Its contents, including the fix's context-failure fake fields, live in fake_runner_test.go and the related split test files. - network.go keeps the refactored layout. The fixed isMissingNetwork lives in transport.go. - network_test.go keeps the refactored layout. The fix's regression tests live in network_errors_test.go. The merged tree is identical to a22146f, and make check-all passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Aleksandergreg
added a commit
that referenced
this pull request
Sep 30, 2026
🤖 I have created a release *beep* *boop* --- ## [0.8.1](v0.8.0...v0.8.1) (2026-09-30) ### Bug Fixes * **docker:** treat only reference-specific errors as missing networks ([#35](#35)) ([1fa140c](1fa140c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Aleksandergreg <144420230+Aleksandergreg@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
isMissingNetworktreated any Docker output containing "not found" as a missing network. When the selected Docker context is unavailable, the CLI printscontext "x": context not found, and that was misread as a missing network:docker_network_absentpassed while the network still existed.Closedropped the network from its retryable cleanup set, so all lab networks leaked once the context recovered.This fix was committed on
feat/docker-networksafter #34 was squash-merged, so it is not inmainor in release 0.8.0.Fix
A network counts as missing only when Docker names the exact reference:
network <ref> not found(current engines, verified on Docker 29.7.2);No such network: <ref>(older engines).Every caller passes its exact reference: inspect,
Close, and the orphan janitor. Context, transport, and CLI failures now propagate as errors.Tests
context not foundoutput.Closeremoves every network after recovery.All three fail against the old substring match.
Validation (on
main+ this commit)make check-all: passed, including race detection and the smoke testOPSQUEST_DOCKER_TEST=1 go test ./internal/dockerlab -run Integration: all 6 passed on Docker Desktop 29.7.2🤖 Generated with Claude Code