Switch to google/uuid from satori/go.uuid (#2852)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -7,8 +7,6 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
uuid "github.com/satori/go.uuid"
|
||||
|
||||
"go.uber.org/zap"
|
||||
authorizationv1 "k8s.io/api/authorization/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
@@ -18,6 +16,8 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
|
||||
"github.com/fission/fission/pkg/utils/uuid"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -292,11 +292,8 @@ func createGetSA(ctx context.Context, k8sClient kubernetes.Interface, SAName, ns
|
||||
|
||||
// generateSuffix generates a random string of 6 characters
|
||||
func generateSuffix() (string, error) {
|
||||
id, err := uuid.NewV4()
|
||||
if err != nil {
|
||||
return "", nil
|
||||
}
|
||||
return id.String()[:6], nil
|
||||
id := uuid.NewString()
|
||||
return id[:6], nil
|
||||
}
|
||||
|
||||
func createServiceAccount() bool {
|
||||
|
||||
+2
-6
@@ -31,12 +31,12 @@ import (
|
||||
|
||||
"github.com/mholt/archiver/v3"
|
||||
"github.com/pkg/errors"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"golang.org/x/net/context/ctxhttp"
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
"github.com/fission/fission/pkg/utils/uuid"
|
||||
)
|
||||
|
||||
func UrlForFunction(name, namespace string) string {
|
||||
@@ -60,11 +60,7 @@ func GetFunctionIstioServiceName(fnName, fnNamespace string) string {
|
||||
|
||||
// GetTempDir creates and return a temporary directory
|
||||
func GetTempDir() (string, error) {
|
||||
id, err := uuid.NewV4()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
tmpDir := id.String()
|
||||
tmpDir := uuid.NewString()
|
||||
dir, err := os.MkdirTemp("", tmpDir)
|
||||
return dir, err
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package uuid
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
)
|
||||
|
||||
func NewUUID() types.UID {
|
||||
return types.UID(uuid.New().String())
|
||||
}
|
||||
|
||||
func NewString() string {
|
||||
return uuid.New().String()
|
||||
}
|
||||
Reference in New Issue
Block a user