Skip to content

Commit

Permalink
Switch to Google's uuid module
Browse files Browse the repository at this point in the history
`satori/uuid` repo is dead and has different problems as shown in
satori/go.uuid#84

Although a fork exists to continue `satori/uuid`, Google's module is
simpler and already used as indirect dependency.

Signed-off-by: Mikel Olasagasti Uranga <[email protected]>
  • Loading branch information
mikelolasagasti committed Apr 20, 2024
1 parent 11f8a31 commit dd822e1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/openshift/api v0.0.0-20230213134911-7ba313770556
github.com/operator-framework/api v0.13.0
github.com/pkg/errors v0.9.1
github.com/satori/go.uuid v1.2.0
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.9.0
golang.org/x/term v0.15.0
Expand All @@ -29,6 +28,7 @@ require (

require (
github.com/charmbracelet/log v0.4.0
github.com/google/uuid v1.6.0
github.com/h2non/gock v1.2.0
)

Expand Down Expand Up @@ -74,7 +74,6 @@ require (
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
Expand Down
5 changes: 2 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,9 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaU
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
Expand Down Expand Up @@ -606,8 +607,6 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/add_space_users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
clicontext "github.com/kubesaw/ksctl/pkg/context"
. "github.com/kubesaw/ksctl/pkg/test"

uuid "github.com/satori/go.uuid"
uuid "github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -204,10 +204,10 @@ func initAddSpaceUsersTest(t *testing.T, murs ...*toolchainv1alpha1.MasterUserRe
nsTemplateTier := newNSTemplateTier("base")
roles := make(map[string]toolchainv1alpha1.NSTemplateTierSpaceRole)
roles["admin"] = toolchainv1alpha1.NSTemplateTierSpaceRole{
TemplateRef: uuid.NewV4().String(),
TemplateRef: uuid.NewString(),
}
roles["viewer"] = toolchainv1alpha1.NSTemplateTierSpaceRole{
TemplateRef: uuid.NewV4().String(),
TemplateRef: uuid.NewString(),
}
nsTemplateTier.Spec.SpaceRoles = roles
objs := []runtime.Object{space, nsTemplateTier}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/generate/admin-manifests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"testing"

commontest "github.com/codeready-toolchain/toolchain-common/pkg/test"
uuid "github.com/google/uuid"
"github.com/kubesaw/ksctl/pkg/client"
"github.com/kubesaw/ksctl/pkg/configuration"
. "github.com/kubesaw/ksctl/pkg/test"
userv1 "github.com/openshift/api/user/v1"
uuid "github.com/satori/go.uuid"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"

Expand Down Expand Up @@ -131,7 +131,7 @@ func TestSetup(t *testing.T) {

t.Run("if out dir doesn't exist then it creates", func(t *testing.T) {
// given
outTempDir := filepath.Join(os.TempDir(), fmt.Sprintf("setup-cli-test-%s", uuid.NewV4().String()))
outTempDir := filepath.Join(os.TempDir(), fmt.Sprintf("setup-cli-test-%s", uuid.NewString()))
term := NewFakeTerminalWithResponse("Y")
term.Tee(os.Stdout)
flags := newSetupFlags(outDir(outTempDir), kubeSawAdminsFile(configFile))
Expand Down
4 changes: 2 additions & 2 deletions pkg/test/usersignup.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/codeready-toolchain/toolchain-common/pkg/states"
"github.com/codeready-toolchain/toolchain-common/pkg/test"

uuid "github.com/satori/go.uuid"
uuid "github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
Expand All @@ -19,7 +19,7 @@ import (
func NewUserSignup(modifiers ...UserSignupModifier) *toolchainv1alpha1.UserSignup {
signup := &toolchainv1alpha1.UserSignup{
ObjectMeta: metav1.ObjectMeta{
Name: uuid.NewV4().String(),
Name: uuid.NewString(),
Namespace: test.HostOperatorNs,
Labels: map[string]string{
toolchainv1alpha1.UserSignupUserEmailHashLabelKey: "fd2addbd8d82f0d2dc088fa122377eaa",
Expand Down

0 comments on commit dd822e1

Please sign in to comment.