From b06cb9ec60d7ef2dbc280d5b8edc8e12b07c4736 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Mon, 7 Nov 2022 15:25:15 +0800 Subject: [PATCH] remove gofrs uuid Signed-off-by: Lyndon-Li --- go.mod | 1 - go.sum | 2 -- internal/hook/item_hook_handler.go | 4 ++-- pkg/restore/restore.go | 4 ++-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index c69d4c2edd..4223707e37 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 7f200bfc43..9e4c4634b9 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/internal/hook/item_hook_handler.go b/internal/hook/item_hook_handler.go index 0bced9484a..d84f9bcaa6 100644 --- a/internal/hook/item_hook_handler.go +++ b/internal/hook/item_hook_handler.go @@ -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") diff --git a/pkg/restore/restore.go b/pkg/restore/restore.go index 9f1130fc06..bea58fafc4 100644 --- a/pkg/restore/restore.go +++ b/pkg/restore/restore.go @@ -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) }