mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: deprecate NewClientWithOpts in favor of New
Use a more idiomatic name so that it can be used as `client.New()`. We should look if we want `New()` to have different / updated defaults i.e., enable `WithEnv` as default, and have an opt-out and have API- version negotiation enabled by default (with an opt-out option). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -734,7 +734,7 @@ func TestCreateWithMultipleEndpointSettings(t *testing.T) {
|
||||
|
||||
for _, tc := range testcases {
|
||||
t.Run("with API v"+tc.apiVersion, func(t *testing.T) {
|
||||
apiClient, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion(tc.apiVersion))
|
||||
apiClient, err := client.New(client.FromEnv, client.WithVersion(tc.apiVersion))
|
||||
assert.NilError(t, err)
|
||||
|
||||
config := container.Config{
|
||||
|
||||
@@ -63,7 +63,7 @@ func TestContainerNetworkMountsNoChown(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
cli, err := client.NewClientWithOpts(client.FromEnv)
|
||||
cli, err := client.New(client.FromEnv)
|
||||
assert.NilError(t, err)
|
||||
defer cli.Close()
|
||||
|
||||
@@ -524,7 +524,7 @@ func TestContainerBindMountReadOnlyDefault(t *testing.T) {
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), minDaemonVersion), "requires API v"+minDaemonVersion)
|
||||
|
||||
if tc.clientVersion != "" {
|
||||
c, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion(tc.clientVersion))
|
||||
c, err := client.New(client.FromEnv, client.WithVersion(tc.clientVersion))
|
||||
assert.NilError(t, err, "failed to create client with version v%s", tc.clientVersion)
|
||||
apiClient = c
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ func TestStaticIPOutsideSubpool(t *testing.T) {
|
||||
d.StartWithBusybox(ctx, t)
|
||||
defer d.Stop(t)
|
||||
|
||||
apiClient, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion("1.43"))
|
||||
apiClient, err := client.New(client.FromEnv, client.WithVersion("1.43"))
|
||||
assert.NilError(t, err)
|
||||
|
||||
const netname = "subnet-range"
|
||||
|
||||
Reference in New Issue
Block a user