Browse Source

Merge pull request #44261 from thaJeztah/remove_deprecated_pkgs

remove aliases for deprecated pkg/urlutil, pkg/fsutils, pkg/pubsub
Sebastiaan van Stijn 2 years ago
parent
commit
ec3c08d618
5 changed files with 0 additions and 58 deletions
  1. 0 6
      hack/make.ps1
  2. 0 6
      hack/validate/pkg-imports
  3. 0 8
      pkg/fsutils/fsutils_linux.go
  4. 0 17
      pkg/pubsub/publisher.go
  5. 0 21
      pkg/urlutil/deprecated.go

+ 0 - 6
hack/make.ps1

@@ -256,12 +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 -eq "pkg\urlutil\deprecated.go") {
-            # pkg/urlutil is deprecated, but has a temporary alias to help migration,
-            # see https://github.com/moby/moby/pull/43477
-            # TODO(thaJeztah) remove this exception once pkg/urlutil aliases are 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" }

+ 0 - 6
hack/validate/pkg-imports

@@ -10,12 +10,6 @@ unset IFS
 
 badFiles=()
 for f in "${files[@]}"; do
-	if [ "$f" = "pkg/urlutil/deprecated.go" ]; then
-		# pkg/urlutil is deprecated, but has a temporary alias to help migration,
-		# see https://github.com/moby/moby/pull/43477
-		# TODO(thaJeztah) remove this exception once pkg/urlutil aliases are removed
-		continue
-	fi
 	IFS=$'\n'
 	badImports=($(go list -e -f '{{ join .Deps "\n" }}' "$f" | sort -u | grep -vE '^github.com/docker/docker/pkg/' | grep -vE '^github.com/docker/docker/vendor' | grep -E '^github.com/docker/docker' || true))
 	unset IFS

+ 0 - 8
pkg/fsutils/fsutils_linux.go

@@ -1,8 +0,0 @@
-package fsutils // import "github.com/docker/docker/pkg/fsutils"
-
-import "github.com/containerd/continuity/fs"
-
-// SupportsDType returns whether the filesystem mounted on path supports d_type.
-//
-// Deprecated: use github.com/containerd/continuity/fs.SupportsDType
-var SupportsDType = fs.SupportsDType

+ 0 - 17
pkg/pubsub/publisher.go

@@ -1,17 +0,0 @@
-package pubsub // import "github.com/docker/docker/pkg/pubsub"
-
-import "github.com/moby/pubsub"
-
-// NewPublisher creates a new pub/sub publisher to broadcast messages.
-// The duration is used as the send timeout as to not block the publisher publishing
-// messages to other clients if one client is slow or unresponsive.
-// The buffer is used when creating new channels for subscribers.
-//
-// Deprecated: use github.com/moby/pubsub.NewPublisher
-var NewPublisher = pubsub.NewPublisher
-
-// Publisher is basic pub/sub structure. Allows to send events and subscribe
-// to them. Can be safely used from multiple goroutines.
-//
-// Deprecated: use github.com/moby/pubsub.Publisher
-type Publisher = pubsub.Publisher

+ 0 - 21
pkg/urlutil/deprecated.go

@@ -1,21 +0,0 @@
-package urlutil // import "github.com/docker/docker/pkg/urlutil"
-
-import "github.com/docker/docker/builder/remotecontext/urlutil"
-
-// IsURL returns true if the provided str is an HTTP(S) URL.
-//
-// Deprecated: use github.com/docker/docker/builder/remotecontext/urlutil.IsURL
-// to detect build-context type, or use strings.HasPrefix() to check if the
-// string has a https:// or http:// prefix.
-func IsURL(str string) bool {
-	// TODO(thaJeztah) when removing this alias, remove the exception from hack/validate/pkg-imports and hack/make.ps1 (Validate-PkgImports)
-	return urlutil.IsURL(str)
-}
-
-// IsGitURL returns true if the provided str is a git repository URL.
-//
-// Deprecated: use github.com/docker/docker/builder/remotecontext/urlutil.IsGitURL
-func IsGitURL(str string) bool {
-	// TODO(thaJeztah) when removing this alias, remove the exception from hack/validate/pkg-imports and hack/make.ps1 (Validate-PkgImports)
-	return urlutil.IsGitURL(str)
-}