Skip to content

Commit

Permalink
fix #5218 change uuid dependency in cluster autoscaler kamatera provider
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch committed Oct 19, 2022
1 parent 0a46483 commit d7288a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(), "-", ""))
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d7288a6

Please sign in to comment.