mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
The `ErrPortAlreadyAllocated` error was introduced inffd68badc0, and at the time used as sentinel error in the bridge driver. It was later integrated into libnetwork ([libnetwork@672ced7]), and brought back when libnetwork was integrated in v1.7.0;272f8cd4bcAfter libnetwork was integrated, the error was unused as sentinel error, except for locally inside the package as part of a test; git rev-parse --verify HEAD496bc46c88git grep '\.ErrPortAlreadyAllocated' Which is still the case Today; git describe --tags --match="v[0-9]*" HEAD v28.0.0 git rev-parse --verify HEADaf898abe44git grep '\.ErrPortAlreadyAllocated' Same for the `ErrAllPortsAllocated` (added in739d124480) and `ErrUnknownProtocol` (added in303ed3c830) errors, which were never used as sentinel errors, and still aren't; git grep '\.ErrAllPortsAllocated' git grep '\.ErrUnknownProtocol' vendor/github.com/moby/buildkit/client/llb/source.go: if errors.Is(err, gitutil.ErrUnknownProtocol) { This patch; - un-exports these errors as they are not used as sentinel errors - strips down the `ErrPortAlreadyAllocated`, removing the methods that were added, but never used. - removes the `newErrPortAlreadyAllocated` constructor - renames `ErrPortAlreadyAllocated` to `alreadyAllocatedErr` to follow go conventions. [libnetwork@672ced7]:c0474b6438Signed-off-by: Sebastiaan van Stijn <github@gone.nl>