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, IMO Google's module is simpler, even if the
`NewString` function can be bit confusing as doesn't reference UUID V4
in the name as satori's and other modules do.

Signed-off-by: Mikel Olasagasti Uranga <[email protected]>
  • Loading branch information
mikelolasagasti committed Jan 15, 2024
1 parent f262b2b commit 87be7e4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
8 changes: 4 additions & 4 deletions cmd/kube-burner/kube-burner.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/cloud-bulldozer/go-commons/indexers"
"github.com/kube-burner/kube-burner/pkg/prometheus"

uid "github.com/satori/go.uuid"
uid "github.com/google/uuid"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
Expand Down Expand Up @@ -140,7 +140,7 @@ func initCmd() *cobra.Command {
}
},
}
cmd.Flags().StringVar(&uuid, "uuid", uid.NewV4().String(), "Benchmark UUID")
cmd.Flags().StringVar(&uuid, "uuid", uid.NewString(), "Benchmark UUID")
cmd.Flags().StringVarP(&url, "prometheus-url", "u", "", "Prometheus URL")
cmd.Flags().StringVarP(&token, "token", "t", "", "Prometheus Bearer token")
cmd.Flags().StringVar(&username, "username", "", "Prometheus username for authentication")
Expand Down Expand Up @@ -328,7 +328,7 @@ func indexCmd() *cobra.Command {
}
},
}
cmd.Flags().StringVar(&uuid, "uuid", uid.NewV4().String(), "Benchmark UUID")
cmd.Flags().StringVar(&uuid, "uuid", uid.NewString(), "Benchmark UUID")
cmd.Flags().StringVarP(&url, "prometheus-url", "u", "", "Prometheus URL")
cmd.Flags().StringVarP(&token, "token", "t", "", "Prometheus Bearer token")
cmd.Flags().StringVar(&username, "username", "", "Prometheus username for authentication")
Expand Down Expand Up @@ -447,7 +447,7 @@ func alertCmd() *cobra.Command {
}
},
}
cmd.Flags().StringVar(&uuid, "uuid", uid.NewV4().String(), "Benchmark UUID")
cmd.Flags().StringVar(&uuid, "uuid", uid.NewString(), "Benchmark UUID")
cmd.Flags().StringVarP(&url, "prometheus-url", "u", "", "Prometheus URL")
cmd.Flags().StringVarP(&token, "token", "t", "", "Prometheus Bearer token")
cmd.Flags().StringVar(&username, "username", "", "Prometheus username for authentication")
Expand Down
4 changes: 2 additions & 2 deletions cmd/kube-burner/ocp.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"time"

"github.com/cloud-bulldozer/go-commons/indexers"
uid "github.com/google/uuid"
"github.com/kube-burner/kube-burner/pkg/workloads"
uid "github.com/satori/go.uuid"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
Expand All @@ -43,7 +43,7 @@ func openShiftCmd() *cobra.Command {
localIndexing := ocpCmd.PersistentFlags().Bool("local-indexing", false, "Enable local indexing")
ocpCmd.PersistentFlags().StringVar(&workloadConfig.MetricsEndpoint, "metrics-endpoint", "", "YAML file with a list of metric endpoints")
ocpCmd.PersistentFlags().BoolVar(&workloadConfig.Alerting, "alerting", true, "Enable alerting")
ocpCmd.PersistentFlags().StringVar(&workloadConfig.UUID, "uuid", uid.NewV4().String(), "Benchmark UUID")
ocpCmd.PersistentFlags().StringVar(&workloadConfig.UUID, "uuid", uid.NewString(), "Benchmark UUID")
ocpCmd.PersistentFlags().DurationVar(&workloadConfig.Timeout, "timeout", 4*time.Hour, "Benchmark timeout")
ocpCmd.PersistentFlags().IntVar(&workloadConfig.QPS, "qps", 20, "QPS")
ocpCmd.PersistentFlags().IntVar(&workloadConfig.Burst, "burst", 20, "Burst")
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ go 1.19
require (
github.com/Masterminds/sprig/v3 v3.2.2
github.com/cloud-bulldozer/go-commons v1.0.12
github.com/google/uuid v1.5.0
github.com/montanaflynn/stats v0.7.1
github.com/openshift/client-go v0.0.0-20230718165156-6014fb98e86a
github.com/prometheus/common v0.44.0
github.com/satori/go.uuid v1.2.0
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.6.1
golang.org/x/time v0.1.0
Expand Down Expand Up @@ -37,7 +37,6 @@ require (
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4
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/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
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/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.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.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU=
Expand Down Expand Up @@ -470,8 +470,6 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR
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/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/kube-burner/kube-burner/pkg/util"
log "github.com/sirupsen/logrus"

uid "github.com/satori/go.uuid"
uid "github.com/google/uuid"
"gopkg.in/yaml.v3"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/validation"
Expand All @@ -41,7 +41,7 @@ import (

var configSpec = Spec{
GlobalConfig: GlobalConfig{
RUNID: uid.NewV4().String(),
RUNID: uid.NewString(),
GC: false,
GCMetrics: false,
GCTimeout: 1 * time.Hour,
Expand Down

0 comments on commit 87be7e4

Please sign in to comment.