Merge pull request #5559 from Lyndon-Li/remove-gofrs-uuid

Remove dependency on gofrs/uuid
pull/5565/head
lyndon 2022-11-07 16:44:24 +08:00 committed by GitHub
commit 5c98e8805b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 7 deletions

1
go.mod
View File

@ -15,7 +15,6 @@ require (
github.com/evanphx/json-patch v5.6.0+incompatible
github.com/fatih/color v1.13.0
github.com/gobwas/glob v0.2.3
github.com/gofrs/uuid v3.2.0+incompatible
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.8
github.com/google/uuid v1.3.0

2
go.sum
View File

@ -293,8 +293,6 @@ github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJA
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE=
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=

View File

@ -22,7 +22,7 @@ import (
"strings"
"time"
uuid "github.com/gofrs/uuid"
"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
corev1api "k8s.io/api/core/v1"
@ -377,7 +377,7 @@ func getInitContainerFromAnnotation(podName string, annotations map[string]strin
log.Infof("RestoreHook init container for pod %s is using container's default entrypoint", podName, containerImage)
}
if containerName == "" {
uid, err := uuid.NewV4()
uid, err := uuid.NewRandom()
uuidStr := "deadfeed"
if err != nil {
log.Errorf("Failed to generate UUID for container name")

View File

@ -28,7 +28,7 @@ import (
"sync"
"time"
uuid "github.com/gofrs/uuid"
"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
v1 "k8s.io/api/core/v1"
@ -145,7 +145,7 @@ func NewKubernetesRestorer(
resourcePriorities: resourcePriorities,
logger: logger,
pvRenamer: func(string) (string, error) {
veleroCloneUuid, err := uuid.NewV4()
veleroCloneUuid, err := uuid.NewRandom()
if err != nil {
return "", errors.WithStack(err)
}