Skip to content

Commit

Permalink
deps: switch to google/uuid
Browse files Browse the repository at this point in the history
It looks like satori/go.uuid has changed its API in the past (returning
two values rather than one from New), and it is not maintained since
around 2018.

Switch to google/uuid which seems to be well maintained.

Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Oct 19, 2021
1 parent 10c865d commit 16412d0
Show file tree
Hide file tree
Showing 48 changed files with 1,199 additions and 637 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ go 1.16

require (
github.com/blang/semver v3.5.0+incompatible
github.com/google/uuid v1.3.0
github.com/hashicorp/go-multierror v1.0.0
github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b
github.com/mrunalp/fileutils v0.0.0-20160930181131-4ee1cc9a8058
github.com/opencontainers/runtime-spec v1.0.3-0.20201121164853-7413a7f753e1
github.com/opencontainers/selinux v1.0.1-0.20190118194646-2d93b96e1a01
github.com/satori/go.uuid v1.1.0
github.com/sirupsen/logrus v1.0.2-0.20170713114250-a3f95b5c4235
github.com/stretchr/testify v1.1.5-0.20170809224252-890a5c3458b4
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ github.com/blang/semver v3.5.0+incompatible h1:CGxCgetQ64DKk7rdZ++Vfnb1+ogGNnB17
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/davecgh/go-spew v1.1.1-0.20170829195320-a47672248388 h1:c9n+0y02ovmvU9O/gS/fqw6HRlUwG645A2AJckmQVy0=
github.com/davecgh/go-spew v1.1.1-0.20170829195320-a47672248388/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
Expand All @@ -16,8 +18,6 @@ github.com/opencontainers/selinux v1.0.1-0.20190118194646-2d93b96e1a01 h1:dnzLte
github.com/opencontainers/selinux v1.0.1-0.20190118194646-2d93b96e1a01/go.mod h1:+BLncwf63G4dgOzykXAxcmnFlUaOlkDdmw/CqsW6pjs=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/satori/go.uuid v1.1.0 h1:B9KXyj+GzIpJbV7gmr873NsY6zpbxNy24CBtGrk7jHo=
github.com/satori/go.uuid v1.1.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sirupsen/logrus v1.0.2-0.20170713114250-a3f95b5c4235 h1:aPIH7fk87dLHot2nJ8bbakmAgwM4RZJtGEkwQ52pQCg=
github.com/sirupsen/logrus v1.0.2-0.20170713114250-a3f95b5c4235/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/stretchr/testify v1.1.5-0.20170809224252-890a5c3458b4 h1:c5DdG2to+wHgjlxcmknq5BnzaaJ0N0W842kLlOSurXc=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (
"path/filepath"
"time"

"github.com/google/uuid"
tap "github.com/mndrix/tap-go"
"github.com/mrunalp/fileutils"
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/generate"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
)

func main() {
Expand All @@ -31,7 +31,7 @@ func main() {
}

testPath := filepath.Join(bundleDir, "test.json")
r.SetID(uuid.NewV4().String())
r.SetID(uuid.NewString())
// generate a config has all the testing properties
g, err := util.GetDefaultGenerator()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions validation/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/opencontainers/runtime-tools/generate"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
"github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand Down Expand Up @@ -40,7 +40,7 @@ func main() {
util.Fatal(err)
}

containerID := uuid.NewV4().String()
containerID := uuid.NewString()
cases := []struct {
id string
errExpected bool
Expand Down
4 changes: 2 additions & 2 deletions validation/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/opencontainers/runtime-tools/generate"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -34,7 +34,7 @@ func main() {
util.Fatal(err)
}
runningConfig.SetProcessArgs([]string{"sleep", "30"})
containerID := uuid.NewV4().String()
containerID := uuid.NewString()
testRuntime, _ := util.NewRuntime(util.RuntimeCommand, bundleDir)
cases := []struct {
config *generate.Generator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -37,7 +37,7 @@ func main() {
util.Fatal(err)
}

r.SetID(uuid.NewV4().String())
r.SetID(uuid.NewString())
g, err := util.GetDefaultGenerator()
if err != nil {
util.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions validation/delete_resources/delete_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/opencontainers/runtime-tools/cgroups"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -30,7 +30,7 @@ func main() {
util.Fatal(err)
}

r.SetID(uuid.NewV4().String())
r.SetID(uuid.NewString())
g, err := util.GetDefaultGenerator()
if err != nil {
util.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions validation/hooks/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -22,7 +22,7 @@ func main() {
config := util.LifecycleConfig{
Actions: util.LifecycleActionCreate | util.LifecycleActionStart | util.LifecycleActionDelete,
PreCreate: func(r *util.Runtime) error {
r.SetID(uuid.NewV4().String())
r.SetID(uuid.NewString())
g, err := util.GetDefaultGenerator()
if err != nil {
util.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions validation/hooks_stdin/hooks_stdin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
rspecs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func stdinStateCheck(outputDir, hookName string, expectedState rspecs.State) (errs *multierror.Error) {
Expand Down Expand Up @@ -83,7 +83,7 @@ func main() {
if err != nil {
util.Fatal(err)
}
containerID := uuid.NewV4().String()
containerID := uuid.NewString()
defer os.RemoveAll(bundleDir)

var containerPid int
Expand Down
4 changes: 2 additions & 2 deletions validation/kill/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/opencontainers/runtime-tools/generate"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -32,7 +32,7 @@ func main() {
util.Fatal(err)
}
runningConfig.SetProcessArgs([]string{"sleep", "30"})
containerID := uuid.NewV4().String()
containerID := uuid.NewString()

cases := []struct {
config *generate.Generator
Expand Down
4 changes: 2 additions & 2 deletions validation/kill_no_effect/kill_no_effect.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
rspecs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -23,7 +23,7 @@ func main() {
defer os.RemoveAll(bundleDir)

targetErr := specerror.NewError(specerror.KillNonCreateRunHaveNoEffect, fmt.Errorf("attempting to send a signal to a container that is neither `created` nor `running` MUST have no effect on the container"), rspecs.Version)
containerID := uuid.NewV4().String()
containerID := uuid.NewString()
g, err := util.GetDefaultGenerator()
if err != nil {
util.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions validation/killsig/killsig.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
rspecs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

var signals = []string{
Expand All @@ -28,7 +28,7 @@ func main() {
}
defer os.RemoveAll(bundleDir)

containerID := uuid.NewV4().String()
containerID := uuid.NewString()
sigConfig, err := util.GetDefaultGenerator()
if err != nil {
os.RemoveAll(bundleDir)
Expand Down
4 changes: 2 additions & 2 deletions validation/misc_props/misc_props.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
rspecs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func saveConfig(path string, v interface{}) error {
Expand All @@ -39,7 +39,7 @@ func main() {
Unknown string `json:"unknown,omitempty"`
}

containerID := uuid.NewV4().String()
containerID := uuid.NewString()
basicConfig, err := util.GetDefaultGenerator()
if err != nil {
util.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions validation/pidfile/pidfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

tap "github.com/mndrix/tap-go"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -34,7 +34,7 @@ func main() {
Config: g,
Actions: util.LifecycleActionCreate | util.LifecycleActionStart | util.LifecycleActionDelete,
PreCreate: func(r *util.Runtime) error {
r.SetID(uuid.NewV4().String())
r.SetID(uuid.NewString())
r.PidFile = tempPidFile
return nil
},
Expand Down
4 changes: 2 additions & 2 deletions validation/poststart/poststart.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -24,7 +24,7 @@ func main() {
config := util.LifecycleConfig{
Actions: util.LifecycleActionCreate | util.LifecycleActionStart | util.LifecycleActionDelete,
PreCreate: func(r *util.Runtime) error {
r.SetID(uuid.NewV4().String())
r.SetID(uuid.NewString())
g, err := util.GetDefaultGenerator()
if err != nil {
util.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions validation/poststart_fail/poststart_fail.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand Down Expand Up @@ -47,7 +47,7 @@ func main() {
BundleDir: bundleDir,
Actions: util.LifecycleActionCreate | util.LifecycleActionStart | util.LifecycleActionDelete,
PreCreate: func(r *util.Runtime) error {
r.SetID(uuid.NewV4().String())
r.SetID(uuid.NewString())
return nil
},
PreDelete: func(r *util.Runtime) error {
Expand Down
4 changes: 2 additions & 2 deletions validation/poststop/poststop.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -25,7 +25,7 @@ func main() {
config := util.LifecycleConfig{
Actions: util.LifecycleActionCreate | util.LifecycleActionStart | util.LifecycleActionDelete,
PreCreate: func(r *util.Runtime) error {
r.SetID(uuid.NewV4().String())
r.SetID(uuid.NewString())
g, err := util.GetDefaultGenerator()
if err != nil {
util.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions validation/poststop_fail/poststop_fail.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand Down Expand Up @@ -48,7 +48,7 @@ func main() {
BundleDir: bundleDir,
Actions: util.LifecycleActionCreate | util.LifecycleActionStart | util.LifecycleActionDelete,
PreCreate: func(r *util.Runtime) error {
r.SetID(uuid.NewV4().String())
r.SetID(uuid.NewString())
return nil
},
PreDelete: func(r *util.Runtime) error {
Expand Down
4 changes: 2 additions & 2 deletions validation/prestart/prestart.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -23,7 +23,7 @@ func main() {
config := util.LifecycleConfig{
Actions: util.LifecycleActionCreate | util.LifecycleActionStart | util.LifecycleActionDelete,
PreCreate: func(r *util.Runtime) error {
r.SetID(uuid.NewV4().String())
r.SetID(uuid.NewString())
g, err := util.GetDefaultGenerator()
if err != nil {
util.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions validation/prestart_fail/prestart_fail.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -32,7 +32,7 @@ func main() {
}
g.AddPreStartHook(prestart)
g.SetProcessArgs([]string{"sh", "-c", fmt.Sprintf("touch %s", "/output")})
containerID := uuid.NewV4().String()
containerID := uuid.NewString()

config := util.LifecycleConfig{
Config: g,
Expand Down
4 changes: 2 additions & 2 deletions validation/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
rspecs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -25,7 +25,7 @@ func main() {
}
defer os.RemoveAll(bundleDir)

containerID := uuid.NewV4().String()
containerID := uuid.NewString()

r, err := util.NewRuntime(util.RuntimeCommand, bundleDir)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions validation/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
rfc2119 "github.com/opencontainers/runtime-tools/error"
"github.com/opencontainers/runtime-tools/specerror"
"github.com/opencontainers/runtime-tools/validation/util"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
)

func main() {
Expand All @@ -22,7 +22,7 @@ func main() {
util.Fatal(err)
}
g.SetProcessArgs([]string{"true"})
containerID := uuid.NewV4().String()
containerID := uuid.NewString()

cases := []struct {
id string
Expand Down
Loading

0 comments on commit 16412d0

Please sign in to comment.