Switch to google/uuid from satori/go.uuid (#2852)

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2023-10-17 12:19:17 +05:30
committed by GitHub
parent 7b21fbc199
commit c6329ee3db
20 changed files with 58 additions and 124 deletions
+3 -11
View File
@@ -28,9 +28,9 @@ import (
"strconv"
"time"
"github.com/google/uuid"
"github.com/mholt/archiver/v3"
"github.com/pkg/errors"
uuid "github.com/satori/go.uuid"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"go.uber.org/zap"
"golang.org/x/net/context/ctxhttp"
@@ -352,16 +352,8 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
//checking if file is a zip
if match, _ := utils.IsZip(tmpPath); match && !req.KeepArchive {
// unarchive tmp file to a tmp unarchive path
id, err := uuid.NewV4()
if err != nil {
logger.Error("error generating uuid",
zap.Error(err),
zap.String("archive_location", tmpPath))
return http.StatusInternalServerError, err
}
tmpUnarchivePath := filepath.Join(fetcher.sharedVolumePath, id.String())
err = fetcher.unarchive(tmpPath, tmpUnarchivePath)
tmpUnarchivePath := filepath.Join(fetcher.sharedVolumePath, uuid.NewString())
err := fetcher.unarchive(tmpPath, tmpUnarchivePath)
if err != nil {
logger.Error("error unarchive",
zap.Error(err),