Skip to content

Commit d0dfb84

Browse files
authored
Merge pull request docker#10953 from thaJeztah/drop_uuid
pkg/api: replace uuid for basic random id
2 parents d6f842b + 8caa6f1 commit d0dfb84

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pkg/api/dryrunclient.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package api
1919
import (
2020
"bytes"
2121
"context"
22+
"crypto/rand"
2223
"encoding/json"
2324
"fmt"
2425
"io"
@@ -31,8 +32,6 @@ import (
3132
"github.com/docker/buildx/builder"
3233
"github.com/docker/buildx/util/imagetools"
3334
"github.com/docker/cli/cli/command"
34-
35-
"github.com/distribution/distribution/v3/uuid"
3635
moby "github.com/docker/docker/api/types"
3736
containerType "github.com/docker/docker/api/types/container"
3837
"github.com/docker/docker/api/types/events"
@@ -298,7 +297,9 @@ func (d *DryRunClient) VolumeRemove(ctx context.Context, volumeID string, force
298297
}
299298

300299
func (d *DryRunClient) ContainerExecCreate(ctx context.Context, container string, config moby.ExecConfig) (moby.IDResponse, error) {
301-
id := uuid.Generate().String()
300+
b := make([]byte, 32)
301+
_, _ = rand.Read(b)
302+
id := fmt.Sprintf("%x", b)
302303
d.execs.Store(id, execDetails{
303304
container: container,
304305
command: config.Cmd,

pkg/e2e/watch_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package e2e
1818

1919
import (
20+
"crypto/rand"
2021
"fmt"
2122
"os"
2223
"path/filepath"
@@ -26,7 +27,6 @@ import (
2627
"testing"
2728
"time"
2829

29-
"github.com/distribution/distribution/v3/uuid"
3030
"github.com/stretchr/testify/require"
3131
"gotest.tools/v3/assert"
3232
"gotest.tools/v3/assert/cmp"
@@ -127,7 +127,9 @@ func doTest(t *testing.T, svcName string, tarSync bool) {
127127
}
128128

129129
waitForFlush := func() {
130-
sentinelVal := uuid.Generate().String()
130+
b := make([]byte, 32)
131+
_, _ = rand.Read(b)
132+
sentinelVal := fmt.Sprintf("%x", b)
131133
writeDataFile("wait.txt", sentinelVal)
132134
poll.WaitOn(t, checkFileContents("/app/data/wait.txt", sentinelVal))
133135
}

0 commit comments

Comments
 (0)