Replace GenerateRandomID with GenerateNonCryptoID

This allow us to avoid entropy usage in non-crypto critical places.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 6bca8ec3c9ccc169c53b3d7060fe5c8ba8670aac
Component: engine
This commit is contained in:
Alexander Morozov
2015-07-28 22:31:01 -07:00
parent 5ca33487e4
commit 67bf5ba305
11 changed files with 32 additions and 32 deletions
+5 -5
View File
@@ -68,7 +68,7 @@ func TestInterruptedRegister(t *testing.T) {
defer nukeGraph(graph)
badArchive, w := io.Pipe() // Use a pipe reader as a fake archive which never yields data
image := &image.Image{
ID: stringid.GenerateRandomID(),
ID: stringid.GenerateNonCryptoID(),
Comment: "testing",
Created: time.Now(),
}
@@ -126,7 +126,7 @@ func TestRegister(t *testing.T) {
t.Fatal(err)
}
image := &image.Image{
ID: stringid.GenerateRandomID(),
ID: stringid.GenerateNonCryptoID(),
Comment: "testing",
Created: time.Now(),
}
@@ -229,19 +229,19 @@ func TestByParent(t *testing.T) {
graph, _ := tempGraph(t)
defer nukeGraph(graph)
parentImage := &image.Image{
ID: stringid.GenerateRandomID(),
ID: stringid.GenerateNonCryptoID(),
Comment: "parent",
Created: time.Now(),
Parent: "",
}
childImage1 := &image.Image{
ID: stringid.GenerateRandomID(),
ID: stringid.GenerateNonCryptoID(),
Comment: "child1",
Created: time.Now(),
Parent: parentImage.ID,
}
childImage2 := &image.Image{
ID: stringid.GenerateRandomID(),
ID: stringid.GenerateNonCryptoID(),
Comment: "child2",
Created: time.Now(),
Parent: parentImage.ID,