Skip to content

Commit f4fff92

Browse files
committed
cli-plugins/socket: use stringid instead of distribution's uuid package
The "github.com/docker/distribution" module moved to the distribution org ("github.com/docker/distribution/v3"), and the new module deprecated and removed the uuid package in favor of Google's UUID package. While we still depend on the old module through packages and as an indirect dependency, we may want to try avoid using it. This patch replaces the use for the socket package, and replaces it for the stringid package, which should be random enough for this purpose. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 514802c commit f4fff92

File tree

25 files changed

+2
-1455
lines changed

25 files changed

+2
-1455
lines changed

cli-plugins/socket/socket.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"net"
77
"os"
88

9-
"github.com/google/uuid"
9+
"github.com/docker/docker/pkg/stringid"
1010
)
1111

1212
// EnvKey represents the well-known environment variable used to pass the plugin being
@@ -17,7 +17,7 @@ const EnvKey = "DOCKER_CLI_PLUGIN_SOCKET"
1717
// and update the conn pointer, and returns the listener for the socket (which the caller
1818
// is responsible for closing when it's no longer needed).
1919
func SetupConn(conn **net.UnixConn) (*net.UnixListener, error) {
20-
listener, err := listen("docker_cli_" + uuid.New().String())
20+
listener, err := listen("docker_cli_" + stringid.GenerateRandomID())
2121
if err != nil {
2222
return nil, err
2323
}

vendor.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ require (
2020
github.com/gogo/protobuf v1.3.2
2121
github.com/google/go-cmp v0.6.0
2222
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
23-
github.com/google/uuid v1.6.0
2423
github.com/mattn/go-runewidth v0.0.15
2524
github.com/mitchellh/mapstructure v1.5.0
2625
github.com/moby/patternmatcher v0.6.0

vendor.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
116116
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
117117
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
118118
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
119-
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
120-
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
121119
github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
122120
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
123121
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=

vendor/github.com/google/uuid/CHANGELOG.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

vendor/github.com/google/uuid/CONTRIBUTING.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

vendor/github.com/google/uuid/CONTRIBUTORS

Lines changed: 0 additions & 9 deletions
This file was deleted.

vendor/github.com/google/uuid/LICENSE

Lines changed: 0 additions & 27 deletions
This file was deleted.

vendor/github.com/google/uuid/README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

vendor/github.com/google/uuid/dce.go

Lines changed: 0 additions & 80 deletions
This file was deleted.

vendor/github.com/google/uuid/doc.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)