Repository: supabase/cli
Pull request #2667 (2024-09-10 04:55:45)

chore(deps): bump github.com/docker/cli from 26.1.5+incompatible to 27.2.1+incompatible
Bumps [github.com/docker/cli](https://github.com/docker/cli) from 26.1.5+incompatible to 27.2.1+incompatible.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/docker/cli/commit/9e34c9bb39efd8bf96d4ec044de454ef1f24c668"><code>9e34c9b</code></a> Merge pull request <a href="https://redirect.github.com/docker/cli/issues/5414">#5414</a> from vvoland/vendor-docker</li>
<li><a href="https://github.com/docker/cli/commit/324cdbca40f2dafe0f0e2aa512fca16a81a51879"><code>324cdbc</code></a> vendor: github.com/docker/docker v27.2.1-dev (8b539b8df240)</li>
<li><a href="https://github.com/docker/cli/commit/b5290d4e0b7638f4092f98cc79e7a2efbdc10b61"><code>b5290d4</code></a> Merge pull request <a href="https://redirect.github.com/docker/cli/issues/5411">#5411</a> from vvoland/5410-27.x</li>
<li><a href="https://github.com/docker/cli/commit/3db95387483fd47d3f75d8adab914909d59a3082"><code>3db9538</code></a> update to go1.22.7</li>
<li><a href="https://github.com/docker/cli/commit/1ab89e71fa51990b2ab2182106658820b8f151d9"><code>1ab89e7</code></a> Merge pull request <a href="https://redirect.github.com/docker/cli/issues/5409">#5409</a> from thaJeztah/27.x_update_docker</li>
<li><a href="https://github.com/docker/cli/commit/667d9fd4df9ce9a73cf87e5b2c2fbbffcddd7a4f"><code>667d9fd</code></a> Merge pull request <a href="https://redirect.github.com/docker/cli/issues/5408">#5408</a> from thaJeztah/27.x_backport_mod_tidy</li>
<li><a href="https://github.com/docker/cli/commit/41e61c45d93058ac5806c8b33264b6bf02c05c2a"><code>41e61c4</code></a> [27.x] vendor: github.com/docker/docker v27.2.0</li>
<li><a href="https://github.com/docker/cli/commit/869df100647353d0bdf64d1ec5210d2b12806fce"><code>869df10</code></a> vendor.mod: put github.com/pkg/browser in the right group</li>
<li><a href="https://github.com/docker/cli/commit/6feee4ab35098af5b2d0cd6d57fc79a4e51e86d2"><code>6feee4a</code></a> Merge pull request <a href="https://redirect.github.com/docker/cli/issues/5402">#5402</a> from laurazard/backport-27.x-login-not-interactive</li>
<li><a href="https://github.com/docker/cli/commit/d0c1a80617dafda8d729bc482d51b4ff8609cd7f"><code>d0c1a80</code></a> login: handle non-tty scenario consistently</li>
<li>Additional commits viewable in <a href="https://github.com/docker/cli/compare/v26.1.5...v27.2.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/docker/cli&package-manager=go_modules&previous-version=26.1.5+incompatible&new-version=27.2.1+incompatible)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/go.mod b/go.mod
index 09427dee..20656c2f 100644
--- a/go.mod
+++ b/go.mod
@@ -14,8 +14,8 @@ require (
 	github.com/containers/common v0.59.2
 	github.com/danieljoos/wincred v1.2.1
 	github.com/deepmap/oapi-codegen/v2 v2.2.0
-	github.com/docker/cli v26.1.5+incompatible
-	github.com/docker/docker v26.1.5+incompatible
+	github.com/docker/cli v27.2.1+incompatible
+	github.com/docker/docker v27.2.1+incompatible
 	github.com/docker/go-connections v0.5.0
 	github.com/docker/go-units v0.5.0
 	github.com/getsentry/sentry-go v0.28.1
diff --git a/go.sum b/go.sum
index 9dcf2a2a..9b4c057b 100644
--- a/go.sum
+++ b/go.sum
@@ -234,13 +234,13 @@ github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E
 github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
 github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk=
 github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE=
-github.com/docker/cli v26.1.5+incompatible h1:NxXGSdz2N+Ibdaw330TDO3d/6/f7MvHuiMbuFaIQDTk=
-github.com/docker/cli v26.1.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
+github.com/docker/cli v27.2.1+incompatible h1:U5BPtiD0viUzjGAjV1p0MGB8eVA3L3cbIrnyWmSJI70=
+github.com/docker/cli v27.2.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
 github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
 github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
 github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
-github.com/docker/docker v26.1.5+incompatible h1:NEAxTwEjxV6VbBMBoGG3zPqbiJosIApZjxlbrG9q3/g=
-github.com/docker/docker v26.1.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
+github.com/docker/docker v27.2.1+incompatible h1:fQdiLfW7VLscyoeYEBz7/J8soYFDZV1u6VW6gJEjNMI=
+github.com/docker/docker v27.2.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo=
 github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
 github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
diff --git a/internal/db/branch/create/create.go b/internal/db/branch/create/create.go
index 98996e8c..085e10f9 100644
--- a/internal/db/branch/create/create.go
+++ b/internal/db/branch/create/create.go
@@ -9,7 +9,7 @@ import (
 	"os"
 	"path/filepath"
 
-	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/pkg/stdcopy"
 	"github.com/go-errors/errors"
 	"github.com/spf13/afero"
@@ -70,7 +70,7 @@ func assertNewBranchIsValid(branchPath string, fsys afero.Fs) error {
 }
 
 func createBranch(ctx context.Context, branch string) error {
-	exec, err := utils.Docker.ContainerExecCreate(ctx, utils.DbId, types.ExecConfig{
+	exec, err := utils.Docker.ContainerExecCreate(ctx, utils.DbId, container.ExecOptions{
 		Cmd:          []string{"/bin/bash", "-c", cloneScript},
 		Env:          []string{"DB_NAME=" + branch},
 		AttachStderr: true,
@@ -80,7 +80,7 @@ func createBranch(ctx context.Context, branch string) error {
 		return err
 	}
 	// Read exec output
-	resp, err := utils.Docker.ContainerExecAttach(ctx, exec.ID, types.ExecStartCheck{})
+	resp, err := utils.Docker.ContainerExecAttach(ctx, exec.ID, container.ExecStartOptions{})
 	if err != nil {
 		return err
 	}
diff --git a/internal/db/branch/delete/delete.go b/internal/db/branch/delete/delete.go
index a3bfde6f..f59f5e51 100644
--- a/internal/db/branch/delete/delete.go
+++ b/internal/db/branch/delete/delete.go
@@ -7,7 +7,7 @@ import (
 	"io"
 	"path/filepath"
 
-	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/pkg/stdcopy"
 	"github.com/go-errors/errors"
 	"github.com/spf13/afero"
@@ -58,7 +58,7 @@ func deleteBranchDir(branch string, fsys afero.Fs) error {
 }
 
 func deleteBranchPG(ctx context.Context, branch string) error {
-	exec, err := utils.Docker.ContainerExecCreate(ctx, utils.DbId, types.ExecConfig{
+	exec, err := utils.Docker.ContainerExecCreate(ctx, utils.DbId, container.ExecOptions{
 		Cmd:          []string{"dropdb", "--username", "postgres", "--host", "127.0.0.1", branch},
 		AttachStderr: true,
 		AttachStdout: true,
@@ -67,7 +67,7 @@ func deleteBranchPG(ctx context.Context, branch string) error {
 		return err
 	}
 	// Read exec output
-	resp, err := utils.Docker.ContainerExecAttach(ctx, exec.ID, types.ExecStartCheck{})
+	resp, err := utils.Docker.ContainerExecAttach(ctx, exec.ID, container.ExecStartOptions{})
 	if err != nil {
 		return err
 	}
diff --git a/internal/utils/docker.go b/internal/utils/docker.go
index 8a44c75d..678d93e9 100644
--- a/internal/utils/docker.go
+++ b/internal/utils/docker.go
@@ -20,7 +20,6 @@ import (
 	dockerConfig "github.com/docker/cli/cli/config"
 	dockerFlags "github.com/docker/cli/cli/flags"
 	"github.com/docker/cli/cli/streams"
-	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/image"
@@ -65,10 +64,7 @@ func DockerNetworkCreateIfNotExists(ctx context.Context, mode container.NetworkM
 	if !isUserDefined(mode) {
 		return nil
 	}
-	_, err := Docker.NetworkCreate(ctx, mode.NetworkName(), types.NetworkCreate{
-		CheckDuplicate: true,
-		Labels:         labels,
-	})
+	_, err := Docker.NetworkCreate(ctx, mode.NetworkName(), network.CreateOptions{Labels: labels})
 	// if error is network already exists, no need to propagate to user
 	if errdefs.IsConflict(err) || errors.Is(err, podman.ErrNetworkExists) {
 		return nil
@@ -410,19 +406,19 @@ func DockerStreamLogsOnce(ctx context.Context, containerId string, stdout, stder
 }
 
 // Exec a command once inside a container, returning stdout and throwing error on non-zero exit code.
-func DockerExecOnce(ctx context.Context, container string, env []string, cmd []string) (string, error) {
+func DockerExecOnce(ctx context.Context, containerId string, env []string, cmd []string) (string, error) {
 	stderr := io.Discard
 	if viper.GetBool("DEBUG") {
 		stderr = os.Stderr
 	}
 	var out bytes.Buffer
-	err := DockerExecOnceWithStream(ctx, container, "", env, cmd, &out, stderr)
+	err := DockerExecOnceWithStream(ctx, containerId, "", env, cmd, &out, stderr)
 	return out.String(), err
 }
 
-func DockerExecOnceWithStream(ctx context.Context, container, workdir string, env, cmd []string, stdout, stderr io.Writer) error {
+func DockerExecOnceWithStream(ctx context.Context, containerId, workdir string, env, cmd []string, stdout, stderr io.Writer) error {
 	// Reset shadow database
-	exec, err := Docker.ContainerExecCreate(ctx, container, types.ExecConfig{
+	exec, err := Docker.ContainerExecCreate(ctx, containerId, container.ExecOptions{
 		Env:          env,
 		Cmd:          cmd,
 		WorkingDir:   workdir,
@@ -433,7 +429,7 @@ func DockerExecOnceWithStream(ctx context.Context, container, workdir string, en
 		return errors.Errorf("failed to exec docker create: %w", err)
 	}
 	// Read exec output
-	resp, err := Docker.ContainerExecAttach(ctx, exec.ID, types.ExecStartCheck{})
+	resp, err := Docker.ContainerExecAttach(ctx, exec.ID, container.ExecStartOptions{})
 	if err != nil {
 		return errors.Errorf("failed to exec docker attach: %w", err)
 	}


Test patch:
diff --git a/internal/start/start_test.go b/internal/start/start_test.go
index 645a1cd7..654831cc 100644
--- a/internal/start/start_test.go
+++ b/internal/start/start_test.go
@@ -10,6 +10,7 @@ import (
 	"testing"
 
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/api/types/volume"
 	"github.com/h2non/gock"
 	"github.com/jackc/pgconn"
@@ -85,7 +86,7 @@ func TestDatabaseStart(t *testing.T) {
 		gock.New(utils.Docker.DaemonHost()).
 			Post("/v" + utils.Docker.ClientVersion() + "/networks/create").
 			Reply(http.StatusCreated).
-			JSON(types.NetworkCreateResponse{})
+			JSON(network.CreateResponse{})
 		// Caches all dependencies
 		imageUrl := utils.GetRegistryImageUrl(utils.Config.Db.Image)
 		gock.New(utils.Docker.DaemonHost()).
@@ -201,7 +202,7 @@ func TestDatabaseStart(t *testing.T) {
 		gock.New(utils.Docker.DaemonHost()).
 			Post("/v" + utils.Docker.ClientVersion() + "/networks/create").
 			Reply(http.StatusCreated).
-			JSON(types.NetworkCreateResponse{})
+			JSON(network.CreateResponse{})
 		// Caches all dependencies
 		imageUrl := utils.GetRegistryImageUrl(utils.Config.Db.Image)
 		gock.New(utils.Docker.DaemonHost()).
diff --git a/internal/stop/stop_test.go b/internal/stop/stop_test.go
index dbb8b903..419df28b 100644
--- a/internal/stop/stop_test.go
+++ b/internal/stop/stop_test.go
@@ -9,6 +9,8 @@ import (
 	"testing"
 
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/container"
+	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/api/types/volume"
 	"github.com/h2non/gock"
 	"github.com/spf13/afero"
@@ -33,11 +35,11 @@ func TestStopCommand(t *testing.T) {
 		gock.New(utils.Docker.DaemonHost()).
 			Post("/v" + utils.Docker.ClientVersion() + "/containers/prune").
 			Reply(http.StatusOK).
-			JSON(types.ContainersPruneReport{})
+			JSON(container.PruneReport{})
 		gock.New(utils.Docker.DaemonHost()).
 			Post("/v" + utils.Docker.ClientVersion() + "/networks/prune").
 			Reply(http.StatusOK).
-			JSON(types.NetworksPruneReport{})
+			JSON(network.PruneReport{})
 		gock.New(utils.Docker.DaemonHost()).
 			Get("/v" + utils.Docker.ClientVersion() + "/volumes").
 			Reply(http.StatusOK).
@@ -94,11 +96,11 @@ func TestStopServices(t *testing.T) {
 		gock.New(utils.Docker.DaemonHost()).
 			Post("/v" + utils.Docker.ClientVersion() + "/containers/prune").
 			Reply(http.StatusOK).
-			JSON(types.ContainersPruneReport{})
+			JSON(container.PruneReport{})
 		gock.New(utils.Docker.DaemonHost()).
 			Post("/v" + utils.Docker.ClientVersion() + "/networks/prune").
 			Reply(http.StatusOK).
-			JSON(types.NetworksPruneReport{})
+			JSON(network.PruneReport{})
 		// Run test
 		err := stop(context.Background(), true, io.Discard)
 		// Check error
diff --git a/internal/testing/apitest/docker.go b/internal/testing/apitest/docker.go
index 37f5549e..21a4d7dd 100644
--- a/internal/testing/apitest/docker.go
+++ b/internal/testing/apitest/docker.go
@@ -8,6 +8,7 @@ import (
 	"github.com/docker/docker/api"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/container"
+	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/api/types/volume"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/pkg/stdcopy"
@@ -38,7 +39,7 @@ func MockDockerStart(docker *client.Client, image, containerID string) {
 	gock.New(docker.DaemonHost()).
 		Post("/v" + docker.ClientVersion() + "/networks/create").
 		Reply(http.StatusCreated).
-		JSON(types.NetworkCreateResponse{})
+		JSON(network.CreateResponse{})
 	gock.New(docker.DaemonHost()).
 		Post("/v" + docker.ClientVersion() + "/volumes/create").
 		Persist().
@@ -62,15 +63,15 @@ func MockDockerStop(docker *client.Client) {
 	gock.New(docker.DaemonHost()).
 		Post("/v" + docker.ClientVersion() + "/containers/prune").
 		Reply(http.StatusOK).
-		JSON(types.ContainersPruneReport{})
+		JSON(container.PruneReport{})
 	gock.New(docker.DaemonHost()).
 		Post("/v" + docker.ClientVersion() + "/volumes/prune").
 		Reply(http.StatusOK).
-		JSON(types.VolumesPruneReport{})
+		JSON(volume.PruneReport{})
 	gock.New(docker.DaemonHost()).
 		Post("/v" + docker.ClientVersion() + "/networks/prune").
 		Reply(http.StatusOK).
-		JSON(types.NetworksPruneReport{})
+		JSON(network.PruneReport{})
 }
 
 // Ref: internal/utils/docker.go::DockerRunOnce
diff --git a/internal/utils/docker_test.go b/internal/utils/docker_test.go
index a3f92bd0..6a0cdf03 100644
--- a/internal/utils/docker_test.go
+++ b/internal/utils/docker_test.go
@@ -9,6 +9,7 @@ import (
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/container"
+	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/pkg/jsonmessage"
 	"github.com/docker/docker/pkg/stdcopy"
 	"github.com/h2non/gock"
@@ -133,7 +134,7 @@ func TestRunOnce(t *testing.T) {
 		gock.New(Docker.DaemonHost()).
 			Post("/v" + Docker.ClientVersion() + "/networks/create").
 			Reply(http.StatusCreated).
-			JSON(types.NetworkCreateResponse{})
+			JSON(network.CreateResponse{})
 		gock.New(Docker.DaemonHost()).
 			Post("/v" + Docker.ClientVersion() + "/containers/create").
 			Reply(http.StatusServiceUnavailable)
@@ -155,7 +156,7 @@ func TestRunOnce(t *testing.T) {
 		gock.New(Docker.DaemonHost()).
 			Post("/v" + Docker.ClientVersion() + "/networks/create").
 			Reply(http.StatusCreated).
-			JSON(types.NetworkCreateResponse{})
+			JSON(network.CreateResponse{})
 		gock.New(Docker.DaemonHost()).
 			Post("/v" + Docker.ClientVersion() + "/containers/create").
 			Reply(http.StatusOK).
diff --git a/test/branch_test.go b/test/branch_test.go
index a3d86902..07d3608d 100644
--- a/test/branch_test.go
+++ b/test/branch_test.go
@@ -5,7 +5,7 @@ import (
 	"encoding/json"
 	"os"
 
-	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/container"
 	"github.com/stretchr/testify/require"
 )
 
@@ -31,8 +31,8 @@ func (suite *DBTestSuite) TestBranchCreate() {
 
 	// check commands in exec calls
 	require.Equal(suite.T(), 2, len(suite.bodies))
-	var execBody types.ExecConfig
+	var execBody container.ExecOptions
 	require.NoError(suite.T(), json.Unmarshal([]byte(suite.bodies[0]), &execBody))
-	var startBody types.ExecStartCheck
+	var startBody container.ExecStartOptions
 	require.NoError(suite.T(), json.Unmarshal([]byte(suite.bodies[1]), &startBody))
 }