Switch to google/uuid from satori/go.uuid (#2852)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -24,7 +24,6 @@ import (
|
||||
|
||||
"github.com/dchest/uniuri"
|
||||
"github.com/pkg/errors"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
@@ -34,6 +33,7 @@ import (
|
||||
"github.com/fission/fission/pkg/fission-cli/console"
|
||||
flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
|
||||
"github.com/fission/fission/pkg/fission-cli/util"
|
||||
"github.com/fission/fission/pkg/utils/uuid"
|
||||
)
|
||||
|
||||
type CreateSubCommand struct {
|
||||
@@ -179,11 +179,7 @@ func CreatePackage(input cli.Input, client cmd.Client, pkgName string, pkgNamesp
|
||||
}
|
||||
|
||||
if len(pkgName) == 0 {
|
||||
id, err := uuid.NewV4()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "error generating UUID")
|
||||
}
|
||||
pkgName = strings.ToLower(id.String())
|
||||
pkgName = strings.ToLower(uuid.NewString())
|
||||
}
|
||||
|
||||
pkg := &fv1.Package{
|
||||
|
||||
@@ -27,7 +27,6 @@ import (
|
||||
"github.com/dchest/uniuri"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/pkg/errors"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
@@ -40,6 +39,7 @@ import (
|
||||
flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
|
||||
"github.com/fission/fission/pkg/fission-cli/util"
|
||||
"github.com/fission/fission/pkg/utils"
|
||||
"github.com/fission/fission/pkg/utils/uuid"
|
||||
)
|
||||
|
||||
// CreateArchive returns a fv1.Archive made from an archive . If specFile, then
|
||||
@@ -124,11 +124,7 @@ func CreateArchive(client cmd.Client, input cli.Input, includeFiles []string, no
|
||||
return nil, err
|
||||
}
|
||||
|
||||
id, err := uuid.NewV4()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
file := filepath.Join(tmpDir, id.String())
|
||||
file := filepath.Join(tmpDir, uuid.NewString())
|
||||
err = utils.DownloadUrl(input.Context(), http.DefaultClient, fileURL, file)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "error downloading file from the given URL")
|
||||
|
||||
@@ -27,13 +27,13 @@ import (
|
||||
"text/tabwriter"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
"github.com/fission/fission/pkg/fission-cli/cmd"
|
||||
"github.com/fission/fission/pkg/fission-cli/util"
|
||||
storageSvcClient "github.com/fission/fission/pkg/storagesvc/client"
|
||||
"github.com/fission/fission/pkg/utils"
|
||||
"github.com/fission/fission/pkg/utils/uuid"
|
||||
)
|
||||
|
||||
func UploadArchiveFile(ctx context.Context, client cmd.Client, fileName string) (*fv1.Archive, error) {
|
||||
@@ -141,11 +141,7 @@ func DownloadToTempFile(fileUrl string) (string, error) {
|
||||
return "", errors.Wrapf(err, "error creating temp directory %v", tmpDir)
|
||||
}
|
||||
|
||||
id, err := uuid.NewV4()
|
||||
if err != nil {
|
||||
return "", errors.Wrapf(err, "error generating UUID")
|
||||
}
|
||||
tmpFilename := id.String()
|
||||
tmpFilename := uuid.NewString()
|
||||
destination := filepath.Join(tmpDir, tmpFilename)
|
||||
|
||||
err = WriteArchiveToFile(destination, reader)
|
||||
@@ -209,11 +205,8 @@ func WriteArchiveToFile(fileName string, reader io.Reader) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
id, err := uuid.NewV4()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tmpFileName := id.String()
|
||||
|
||||
tmpFileName := uuid.NewString()
|
||||
|
||||
path := filepath.Join(tmpDir, tmpFileName+".tmp")
|
||||
w, err := os.Create(path)
|
||||
|
||||
Reference in New Issue
Block a user