[client] Remove duplicate NewClient functions#34899
Conversation
|
CI is failing 😢 |
69e0266 to
ccf5103
Compare
b2990da to
818393f
Compare
2ba31f4 to
a65413e
Compare
d1fe81f to
7c09dc5
Compare
3d4ae0e to
ca1b31e
Compare
client/client.go
Outdated
There was a problem hiding this comment.
Codecov Report
@@ Coverage Diff @@
## master #34899 +/- ##
=========================================
Coverage ? 34.31%
=========================================
Files ? 609
Lines ? 45308
Branches ? 0
=========================================
Hits ? 15549
Misses ? 27759
Partials ? 2000 |
hack/make/.integration-daemon-start
Outdated
There was a problem hiding this comment.
I removed this because it was causing DockerSuite.TestBuildWithSession to fail.
I don't think we should be setting an explicit API version here. The client package uses this version to disable some features, so setting it to an old version makes it impossible to test those features.
I believe the pinned version of the cli we are using can properly negotiate the API version.
client/client_test.go
Outdated
There was a problem hiding this comment.
I noticed env.Patch() and env.PatchAll() have a difference in behaviour; where env.Patch() actually patches the current environment variables, env.PatchAll() is overriding the current environment (i.e., it removes all existing environment variables); https://github.com/gotestyourself/gotestyourself/blob/511344eed30e4384f010579a593dfb442033a692/env/env.go#L40-L45
I wonder if that function needs to have a different name, or if the os.ClearEnv() should be removed
There was a problem hiding this comment.
Yes, that is exactly how they are documented: https://godoc.org/github.com/gotestyourself/gotestyourself/env
Patch changes the value of an environment variable
PatchAll sets the environment to env
I wonder if that function needs to have a different name,
All -> "the whole of", complete, entire
I think the name should imply that it replaces everything. What did you expect PatchAll to do?
If it were just a "multi set" version of Patch it would be called something like PatchMany, or MatchMulti, but I think there is little value in such a call, so would not be in favor of adding it.
There was a problem hiding this comment.
The “Patch” part lead me to believe I’d be modifying just what I sent, but keep other values as-is; even more because the “Patch” does so for a single var.
idk, “SetEnv()” / “Override()” would perhaps perhaps be closed to that it does
There was a problem hiding this comment.
I think SetEnv would be too close to https://golang.org/pkg/os/#Setenv, and would be confusing because it's not just SetEnv, it also returns a cleanup function. Override doesn't really have any specific meaning in this context.
Patch here, in the context of testing, refers to Monkey Patching, not the more general patch as in "partial change".
There was a problem hiding this comment.
Perhaps that's where my confusion was; anyway, it's not really related to this PR 😅
There was a problem hiding this comment.
How did this test pass previously on Windows?
There was a problem hiding this comment.
There are some big problems with this test. I think it's actually failing on windows, but all ignores are being ignored because it's ignoring all errors except EOF:
moby/integration-cli/docker_api_exec_resize_test.go
Lines 68 to 79 in 733ed2d
I tried to fix it, but it was failing, so I decided to leave it for another time.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Use client instead of helpers for TLS in integration test Signed-off-by: Daniel Nephin <dnephin@docker.com>
115c2ea to
7ad8dff
Compare
Remove request.SockRequest Remove request.SockRequestHijack Remove request.SockRequestRaw() Remove deprecated ParseHost Deprecate and unexport more helpers Signed-off-by: Daniel Nephin <dnephin@docker.com>
Use the default version because it is used by the client package Signed-off-by: Daniel Nephin <dnephin@docker.com>
7ad8dff to
e73d742
Compare
|
Squashed those 2 commits and fixed a test that was failing |
Improve docstrings in
clientpackageRemove some unnecessary code in
clientAdd more ops to
clientRemove duplicate ways of getting an APIClient for integration testing
Remove some deprecated code