11644: Ensure generated UUIDs are always 27 chars.
authorTom Clegg <tom@curoverse.com>
Tue, 16 May 2017 17:23:02 +0000 (13:23 -0400)
committerTom Clegg <tom@curoverse.com>
Tue, 16 May 2017 17:23:02 +0000 (13:23 -0400)
services/keepstore/volume.go

index 836e8c6fdc918c94be128bee0399c93f89d4c6cf..07b497cc2afd4b70a185e7354001137d3146bd58 100644 (file)
@@ -3,6 +3,7 @@ package main
 import (
        "context"
        "crypto/rand"
+       "fmt"
        "io"
        "math/big"
        "sync/atomic"
@@ -295,7 +296,7 @@ func (*VolumeMount) generateUUID() string {
        if err != nil {
                panic(err)
        }
-       return "zzzzz-ivpuk-" + r.Text(36)
+       return fmt.Sprintf("zzzzz-ivpuk-%015s", r.Text(36))
 }
 
 // RRVolumeManager is a round-robin VolumeManager: the Nth call to