Switch to google/uuid from satori/go.uuid (#2852)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
+3
-11
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user