change uuid dependency in cluster autoscaler kamatera provider

This commit is contained in:
Ori Hoch 2022-10-19 15:18:21 +03:00
parent 0a46483c07
commit c342fc2759
2 changed files with 5 additions and 7 deletions

View File

@ -18,9 +18,8 @@ package kamatera
import (
"context"
"encoding/hex"
"fmt"
"github.com/satori/go.uuid"
"github.com/google/uuid"
"k8s.io/autoscaler/cluster-autoscaler/version"
"k8s.io/klog/v2"
"strings"
@ -266,5 +265,5 @@ func kamateraServerName(namePrefix string) string {
if len(namePrefix) > 0 {
namePrefix = fmt.Sprintf("%s-", namePrefix)
}
return fmt.Sprintf("%s%s", namePrefix, hex.EncodeToString(uuid.NewV4().Bytes()))
return fmt.Sprintf("%s%s", namePrefix, strings.ReplaceAll(uuid.New().String(), "-", ""))
}

View File

@ -18,14 +18,13 @@ package kamatera
import (
"context"
"encoding/hex"
"fmt"
uuid "github.com/satori/go.uuid"
"github.com/google/uuid"
"github.com/stretchr/testify/mock"
"strings"
)
func mockKamateraServerName() string {
return fmt.Sprintf("%s", hex.EncodeToString(uuid.NewV4().Bytes()))
return strings.ReplaceAll(uuid.New().String(), "-", "")
}
func mockServerConfig(namePrefix string, tags []string) ServerConfig {