Skip to content

Commit 81caaba

Browse files
authored
Merge pull request moby#50462 from thaJeztah/move_stdcopy
deprecate pkg/stdcopy, move to api/stdcopy
2 parents b5d7d6c + 20d594f commit 81caaba

File tree

31 files changed

+270
-26
lines changed

31 files changed

+270
-26
lines changed

client/container_attach.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
// SIZE1, SIZE2, SIZE3, and SIZE4 are four bytes of uint32 encoded as big endian.
3232
// This is the size of OUTPUT.
3333
//
34-
// You can use github.com/docker/docker/pkg/stdcopy.StdCopy to demultiplex this
34+
// You can use github.com/moby/moby/api/stdcopy.StdCopy to demultiplex this
3535
// stream.
3636
func (cli *Client) ContainerAttach(ctx context.Context, containerID string, options container.AttachOptions) (types.HijackedResponse, error) {
3737
containerID, err := trimID("container", containerID)

client/container_exec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (cli *Client) ContainerExecStart(ctx context.Context, execID string, config
6868
// - If the container is *not* using a TTY, streams for stdout and stderr are
6969
// multiplexed.
7070
//
71-
// You can use [github.com/docker/docker/pkg/stdcopy.StdCopy] to demultiplex this
71+
// You can use [github.com/moby/moby/api/stdcopy.StdCopy] to demultiplex this
7272
// stream. Refer to [Client.ContainerAttach] for details about the multiplexed
7373
// stream.
7474
func (cli *Client) ContainerExecAttach(ctx context.Context, execID string, config container.ExecAttachOptions) (types.HijackedResponse, error) {

client/container_logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
// SIZE1, SIZE2, SIZE3, and SIZE4 are four bytes of uint32 encoded as big endian.
3232
// This is the size of OUTPUT.
3333
//
34-
// You can use github.com/docker/docker/pkg/stdcopy.StdCopy to demultiplex this
34+
// You can use github.com/moby/moby/api/stdcopy.StdCopy to demultiplex this
3535
// stream.
3636
func (cli *Client) ContainerLogs(ctx context.Context, containerID string, options container.LogsOptions) (io.ReadCloser, error) {
3737
containerID, err := trimID("container", containerID)

daemon/attach.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/docker/docker/daemon/internal/stream"
1111
"github.com/docker/docker/daemon/logger"
1212
"github.com/docker/docker/errdefs"
13-
"github.com/docker/docker/pkg/stdcopy"
13+
"github.com/moby/moby/api/stdcopy"
1414
"github.com/moby/moby/api/types/backend"
1515
containertypes "github.com/moby/moby/api/types/container"
1616
"github.com/moby/moby/api/types/events"

daemon/server/httputils/write_log_stream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
"github.com/docker/docker/pkg/ioutils"
1212
"github.com/docker/docker/pkg/jsonmessage"
13-
"github.com/docker/docker/pkg/stdcopy"
13+
"github.com/moby/moby/api/stdcopy"
1414
"github.com/moby/moby/api/types/backend"
1515
"github.com/moby/moby/api/types/container"
1616
)

daemon/server/router/container/exec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/containerd/log"
1010
"github.com/docker/docker/daemon/server/httputils"
1111
"github.com/docker/docker/errdefs"
12-
"github.com/docker/docker/pkg/stdcopy"
12+
"github.com/moby/moby/api/stdcopy"
1313
"github.com/moby/moby/api/types"
1414
"github.com/moby/moby/api/types/backend"
1515
"github.com/moby/moby/api/types/container"

hack/make.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,15 @@ Function Validate-PkgImports($headCommit, $upstreamCommit) {
256256
$files=@(); $files = Invoke-Expression "git diff $upstreamCommit...$headCommit --diff-filter=ACMR --name-only -- `'pkg\*.go`'"
257257
$badFiles=@(); $files | ForEach-Object{
258258
$file=$_
259+
260+
if ($file -like "pkg\stdcopy\*") {
261+
# Temporarily allow pkg/stdcopy to import "github.com/moby/moby/api/stdcopy",
262+
# because it's an alias for backward-compatibility.
263+
#
264+
# TODO(thaJeztah): remove once "github.com/docker/docker/pkg/stdcopy" is removed.
265+
return
266+
}
267+
259268
# For the current changed file, get its list of dependencies, sorted and uniqued.
260269
$imports = Invoke-Expression "go list -e -f `'{{ .Deps }}`' $file"
261270
if ($LASTEXITCODE -ne 0) { Throw "Failed go list for dependencies on $file" }

hack/validate/pkg-imports

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ unset IFS
1010

1111
badFiles=()
1212
for f in "${files[@]}"; do
13+
case "$f" in
14+
pkg/stdcopy/*)
15+
# Temporarily allow pkg/stdcopy to import "github.com/moby/moby/api/stdcopy",
16+
# because it's an alias for backward-compatibility.
17+
#
18+
# TODO(thaJeztah): remove once "github.com/docker/docker/pkg/stdcopy" is removed.
19+
continue
20+
;;
21+
esac
22+
1323
IFS=$'\n'
1424
badImports=($(go list -e -f '{{ join .Deps "\n" }}' "$f" | sort -u \
1525
| grep -vE '^github.com/docker/docker/pkg/' \

0 commit comments

Comments
 (0)