Skip to content

Commit 71b49e7

Browse files
authored
cleanup(docker): remove unused ClientConfig.HTTPClient field (#684) (#693)
## Summary Removes the \`HTTPClient\` field from \`ClientConfig\`. The field was declared in [#681](#681) but never read by \`createHTTPClient\` or \`NewClientWithConfig\` — a caller setting \`cfg.HTTPClient = someClient\` got the auto-constructed transport instead of theirs. A repo-wide grep confirms zero field-access or struct-literal callers in production code or tests. Only the function name \`createHTTPClient\` and the local variable \`httpClient\` turn up in matches; the field itself has no readers. Closes [#684](#684). ## Design choice The [issue](#684) presented two options: 1. **Honor the field** — useful as a testing seam (inject fake transport). 2. **Remove the field** — more honest about current code. **Chose Option 2** because: - Zero current callers in tests or production — the field is genuinely vestigial. - The equivalent test-seam pattern (\`SetTransportFactoryForTest\`) already exists in \`middlewares/webhook.go\` where it's actually needed. - Honoring the field would also require running \`disableHTTP2AutoConfig\` on caller-supplied transports when the scheme is non-TLS (the #668 invariant), expanding scope significantly for a field nobody uses. - If a future contributor needs a transport-level injection seam, they can add it with a clear use case spelled out — better than reviving a vestigial field. ## Test plan - [x] \`go test ./...\` passes (full repo, 14 packages, ~56s) - [x] \`golangci-lint run\` clean - [x] \`go vet ./...\` clean - [ ] CI green
2 parents 33d4f93 + b8bfd78 commit 71b49e7

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Removed
11+
12+
- **BREAKING (source-only, pre-1.0):** Removed unused `core/adapters/docker.ClientConfig.HTTPClient` field that was declared in [#681](https://github.com/netresearch/ofelia/pull/681) but never read — a caller setting `cfg.HTTPClient = someClient` silently got the auto-constructed transport instead of theirs. Downstream Go consumers that referenced the field in named struct literals or assignments will see a compile-time error after upgrade (semantically a no-op since the field was already ignored at runtime); permitted under SemVer for the current 0.y.z line (cf. [SemVer §4](https://semver.org/#spec-item-4)). Removing the field turns the silent footgun into a loud compile-time error rather than preserving it as a deprecated no-op. If you need a transport-level injection seam, file a feature request with the use case so the suppression of `disableHTTP2AutoConfig` on caller-supplied transports (the [#668](https://github.com/netresearch/ofelia/issues/668) invariant) can be wired in correctly. ([#693](https://github.com/netresearch/ofelia/pull/693), closes [#684](https://github.com/netresearch/ofelia/issues/684))
13+
1014
## [0.25.1] - 2026-05-16
1115

1216
### Added

core/adapters/docker/client.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,6 @@ type ClientConfig struct {
190190
// Version is the API version (empty for auto-negotiation)
191191
Version string
192192

193-
// HTTPClient is a custom HTTP client (optional)
194-
HTTPClient *http.Client
195-
196193
// HTTPHeaders are custom HTTP headers (optional)
197194
HTTPHeaders map[string]string
198195

0 commit comments

Comments
 (0)