From 01c7b4233ceb476b6e24e9ffceb3787ddd19be32 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 22 Jul 2025 23:58:28 +0200 Subject: [PATCH] hack/validate: remove obsolete exception This was added in 20d594fb79949fe61a8cdfde52829ba7ef1a69ed, but was written before the API module was added. Now that the API is a separate module, the check will no longer flag packages importing the API. Signed-off-by: Sebastiaan van Stijn --- hack/make.ps1 | 9 --------- hack/validate/pkg-imports | 10 ---------- pkg/stdcopy/stdcopy_deprecated.go | 4 +--- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/hack/make.ps1 b/hack/make.ps1 index 4accf5019b..1893583c30 100644 --- a/hack/make.ps1 +++ b/hack/make.ps1 @@ -256,15 +256,6 @@ Function Validate-PkgImports($headCommit, $upstreamCommit) { $files=@(); $files = Invoke-Expression "git diff $upstreamCommit...$headCommit --diff-filter=ACMR --name-only -- `'pkg\*.go`'" $badFiles=@(); $files | ForEach-Object{ $file=$_ - - if ($file -like "pkg\stdcopy\*") { - # Temporarily allow pkg/stdcopy to import "github.com/moby/moby/api/stdcopy", - # because it's an alias for backward-compatibility. - # - # TODO(thaJeztah): remove once "github.com/docker/docker/pkg/stdcopy" is removed. - return - } - # For the current changed file, get its list of dependencies, sorted and uniqued. $imports = Invoke-Expression "go list -e -f `'{{ .Deps }}`' $file" if ($LASTEXITCODE -ne 0) { Throw "Failed go list for dependencies on $file" } diff --git a/hack/validate/pkg-imports b/hack/validate/pkg-imports index 2717d5e006..2f50f2de7c 100755 --- a/hack/validate/pkg-imports +++ b/hack/validate/pkg-imports @@ -10,16 +10,6 @@ unset IFS badFiles=() for f in "${files[@]}"; do - case "$f" in - pkg/stdcopy/*) - # Temporarily allow pkg/stdcopy to import "github.com/moby/moby/api/stdcopy", - # because it's an alias for backward-compatibility. - # - # TODO(thaJeztah): remove once "github.com/docker/docker/pkg/stdcopy" is removed. - continue - ;; - esac - IFS=$'\n' badImports=($(go list -e -f '{{ join .Deps "\n" }}' "$f" | sort -u \ | grep -vE '^github.com/docker/docker/pkg/' \ diff --git a/pkg/stdcopy/stdcopy_deprecated.go b/pkg/stdcopy/stdcopy_deprecated.go index e102292da3..927cee2848 100644 --- a/pkg/stdcopy/stdcopy_deprecated.go +++ b/pkg/stdcopy/stdcopy_deprecated.go @@ -1,4 +1,4 @@ -package stdcopy // Deprecated: use [github.com/docker/docker/api/stdcopy] instead. +package stdcopy // Deprecated: use [github.com/moby/moby/api/stdcopy] instead. import ( "io" @@ -6,8 +6,6 @@ import ( "github.com/moby/moby/api/stdcopy" ) -// TODO(thaJeztah): remove exception in hack/make.ps1 and hack/validate/pkg-imports when removing. - // StdType is the type of standard stream // a writer can multiplex to. //