diff --git a/pkg/volume/quobyte/BUILD b/pkg/volume/quobyte/BUILD index f194dfe9e1b..040ead569cb 100644 --- a/pkg/volume/quobyte/BUILD +++ b/pkg/volume/quobyte/BUILD @@ -23,7 +23,7 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", "//staging/src/k8s.io/cloud-provider/volume/helpers:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/github.com/google/uuid:go_default_library", "//vendor/github.com/quobyte/api:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/utils/strings:go_default_library", diff --git a/pkg/volume/quobyte/quobyte.go b/pkg/volume/quobyte/quobyte.go index 3cfc7a800ec..d996c007fba 100644 --- a/pkg/volume/quobyte/quobyte.go +++ b/pkg/volume/quobyte/quobyte.go @@ -22,7 +22,7 @@ import ( "path/filepath" gostrings "strings" - "github.com/pborman/uuid" + "github.com/google/uuid" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -408,7 +408,7 @@ func (provisioner *quobyteVolumeProvisioner) Provision(selectedNode *v1.Node, al } // create random image name - provisioner.volume = fmt.Sprintf("kubernetes-dynamic-pvc-%s", uuid.NewUUID()) + provisioner.volume = fmt.Sprintf("kubernetes-dynamic-pvc-%s", uuid.New().String()) manager := &quobyteVolumeManager{ config: cfg, diff --git a/staging/src/k8s.io/apiextensions-apiserver/go.mod b/staging/src/k8s.io/apiextensions-apiserver/go.mod index 1faf014c78e..635fae42810 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/go.mod +++ b/staging/src/k8s.io/apiextensions-apiserver/go.mod @@ -13,6 +13,7 @@ require ( github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/google/go-cmp v0.3.0 github.com/google/gofuzz v1.0.0 + github.com/google/uuid v1.1.1 github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d github.com/pborman/uuid v1.2.0 github.com/spf13/cobra v0.0.5 diff --git a/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/BUILD b/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/BUILD index 7c451ce7b2d..5a971f80c38 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/BUILD +++ b/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/BUILD @@ -31,7 +31,7 @@ go_library( "//staging/src/k8s.io/client-go/rest:go_default_library", "//staging/src/k8s.io/client-go/restmapper:go_default_library", "//staging/src/k8s.io/client-go/scale:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/github.com/google/uuid:go_default_library", "//vendor/k8s.io/utils/pointer:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/server.go b/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/server.go index 4678bc04f1d..63eaa80cc0f 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/server.go +++ b/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/server.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/pborman/uuid" + "github.com/google/uuid" "k8s.io/apiextensions-apiserver/pkg/cmd/server/options" "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" @@ -59,7 +59,7 @@ users: fakeKubeConfig.Close() s, err := servertesting.StartTestServer(t, nil, append([]string{ - "--etcd-prefix", uuid.New(), + "--etcd-prefix", uuid.New().String(), "--etcd-servers", strings.Join(IntegrationEtcdServers(), ","), "--authentication-skip-lookup", "--authentication-kubeconfig", fakeKubeConfig.Name(), diff --git a/staging/src/k8s.io/apiserver/go.mod b/staging/src/k8s.io/apiserver/go.mod index 826e4f8fe8e..90ebd48e5f7 100644 --- a/staging/src/k8s.io/apiserver/go.mod +++ b/staging/src/k8s.io/apiserver/go.mod @@ -19,6 +19,7 @@ require ( github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/google/go-cmp v0.3.0 github.com/google/gofuzz v1.0.0 + github.com/google/uuid v1.1.1 github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d github.com/gorilla/websocket v1.4.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 diff --git a/staging/src/k8s.io/apiserver/pkg/audit/BUILD b/staging/src/k8s.io/apiserver/pkg/audit/BUILD index 2c01f2c34b0..869175a4620 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/audit/BUILD @@ -37,7 +37,7 @@ go_library( "//staging/src/k8s.io/apiserver/pkg/authorization/authorizer:go_default_library", "//staging/src/k8s.io/component-base/metrics:go_default_library", "//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/github.com/google/uuid:go_default_library", "//vendor/k8s.io/klog:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/pkg/audit/request.go b/staging/src/k8s.io/apiserver/pkg/audit/request.go index 1ac39bc925f..f53dfadf15c 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/request.go +++ b/staging/src/k8s.io/apiserver/pkg/audit/request.go @@ -23,7 +23,7 @@ import ( "reflect" "time" - "github.com/pborman/uuid" + "github.com/google/uuid" "k8s.io/klog" authnv1 "k8s.io/api/authentication/v1" @@ -58,7 +58,7 @@ func NewEventFromRequest(req *http.Request, level auditinternal.Level, attribs a if ids != "" { ev.AuditID = types.UID(ids) } else { - ev.AuditID = types.UID(uuid.NewRandom().String()) + ev.AuditID = types.UID(uuid.New().String()) } ips := utilnet.SourceIPs(req) diff --git a/staging/src/k8s.io/apiserver/pkg/authentication/token/cache/BUILD b/staging/src/k8s.io/apiserver/pkg/authentication/token/cache/BUILD index d4f0a008840..1f08a3a050f 100644 --- a/staging/src/k8s.io/apiserver/pkg/authentication/token/cache/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/authentication/token/cache/BUILD @@ -18,7 +18,7 @@ go_test( "//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library", "//staging/src/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library", "//staging/src/k8s.io/apiserver/pkg/authentication/user:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/github.com/google/uuid:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cache_test.go b/staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cache_test.go index 3b4d68a23f4..ad02cd3df6a 100644 --- a/staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cache_test.go +++ b/staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cache_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/pborman/uuid" + "github.com/google/uuid" "k8s.io/apimachinery/pkg/util/clock" "k8s.io/apiserver/pkg/authentication/authenticator" @@ -50,7 +50,7 @@ func BenchmarkStripedCache(b *testing.B) { func benchmarkCache(cache cache, b *testing.B) { keys := []string{} for i := 0; i < b.N; i++ { - key := uuid.NewRandom().String() + key := uuid.New().String() keys = append(keys, key) } diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/filters/BUILD b/staging/src/k8s.io/apiserver/pkg/endpoints/filters/BUILD index 6dae2be189a..3ebc27f67f7 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/filters/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/filters/BUILD @@ -33,7 +33,7 @@ go_test( "//staging/src/k8s.io/apiserver/pkg/authentication/user:go_default_library", "//staging/src/k8s.io/apiserver/pkg/authorization/authorizer:go_default_library", "//staging/src/k8s.io/apiserver/pkg/endpoints/request:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/github.com/google/uuid:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/filters/audit_test.go b/staging/src/k8s.io/apiserver/pkg/endpoints/filters/audit_test.go index 3d3edd68f8f..e885644f8bd 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/filters/audit_test.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/filters/audit_test.go @@ -26,7 +26,7 @@ import ( "testing" "time" - "github.com/pborman/uuid" + "github.com/google/uuid" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -223,7 +223,7 @@ func TestAudit(t *testing.T) { "short running with auditID", shortRunningPath, "GET", - uuid.NewRandom().String(), + uuid.New().String(), nil, func(w http.ResponseWriter, req *http.Request) { w.Write([]byte("foo")) @@ -422,7 +422,7 @@ func TestAudit(t *testing.T) { "empty longrunning with audit id", longRunningPath, "GET", - uuid.NewRandom().String(), + uuid.New().String(), nil, func(w http.ResponseWriter, req *http.Request) { w.Write([]byte("foo")) @@ -778,7 +778,7 @@ func TestAuditIDHttpHeader(t *testing.T) { }, { "no http header when there is no audit even the request header specified", - uuid.NewRandom().String(), + uuid.New().String(), auditinternal.LevelNone, false, }, @@ -790,7 +790,7 @@ func TestAuditIDHttpHeader(t *testing.T) { }, { "user provided header", - uuid.NewRandom().String(), + uuid.New().String(), auditinternal.LevelRequestResponse, true, }, diff --git a/staging/src/k8s.io/apiserver/pkg/server/BUILD b/staging/src/k8s.io/apiserver/pkg/server/BUILD index 84d5a3e58b0..9029444cb9e 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/server/BUILD @@ -113,7 +113,7 @@ go_library( "//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/github.com/evanphx/json-patch:go_default_library", "//vendor/github.com/go-openapi/spec:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/github.com/google/uuid:go_default_library", "//vendor/golang.org/x/net/http2:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/kube-openapi/pkg/builder:go_default_library", diff --git a/staging/src/k8s.io/apiserver/pkg/server/config.go b/staging/src/k8s.io/apiserver/pkg/server/config.go index 16208954a47..ee8051a0ae3 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/config.go +++ b/staging/src/k8s.io/apiserver/pkg/server/config.go @@ -30,7 +30,7 @@ import ( jsonpatch "github.com/evanphx/json-patch" "github.com/go-openapi/spec" - "github.com/pborman/uuid" + "github.com/google/uuid" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -727,7 +727,7 @@ func AuthorizeClientBearerToken(loopback *restclient.Config, authn *Authenticati } privilegedLoopbackToken := loopback.BearerToken - var uid = uuid.NewRandom().String() + var uid = uuid.New().String() tokens := make(map[string]*user.DefaultInfo) tokens[privilegedLoopbackToken] = &user.DefaultInfo{ Name: user.APIServerUser, diff --git a/staging/src/k8s.io/apiserver/pkg/server/options/BUILD b/staging/src/k8s.io/apiserver/pkg/server/options/BUILD index c38cfd28ced..205de176f6c 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/options/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/server/options/BUILD @@ -82,7 +82,7 @@ go_library( "//staging/src/k8s.io/client-go/util/cert:go_default_library", "//staging/src/k8s.io/client-go/util/keyutil:go_default_library", "//staging/src/k8s.io/component-base/cli/flag:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/github.com/google/uuid:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/gopkg.in/natefinch/lumberjack.v2:go_default_library", "//vendor/k8s.io/klog:go_default_library", diff --git a/staging/src/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go b/staging/src/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go index b19258bf961..9f9a42f81b0 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go +++ b/staging/src/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go @@ -19,7 +19,7 @@ package options import ( "fmt" - "github.com/pborman/uuid" + "github.com/google/uuid" "k8s.io/apiserver/pkg/server" "k8s.io/apiserver/pkg/server/dynamiccertificates" @@ -60,7 +60,7 @@ func (s *SecureServingOptionsWithLoopback) ApplyTo(secureServingInfo **server.Se return fmt.Errorf("failed to generate self-signed certificate for loopback connection: %v", err) } - secureLoopbackClientConfig, err := (*secureServingInfo).NewLoopbackClientConfig(uuid.NewRandom().String(), certPem) + secureLoopbackClientConfig, err := (*secureServingInfo).NewLoopbackClientConfig(uuid.New().String(), certPem) switch { // if we failed and there's no fallback loopback client config, we need to fail case err != nil && *loopbackClientConfig == nil: diff --git a/staging/src/k8s.io/apiserver/plugin/pkg/audit/log/BUILD b/staging/src/k8s.io/apiserver/plugin/pkg/audit/log/BUILD index b781df9c8b4..41e4ce6d817 100644 --- a/staging/src/k8s.io/apiserver/plugin/pkg/audit/log/BUILD +++ b/staging/src/k8s.io/apiserver/plugin/pkg/audit/log/BUILD @@ -47,6 +47,6 @@ go_test( "//staging/src/k8s.io/apiserver/pkg/apis/audit/v1:go_default_library", "//staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1:go_default_library", "//staging/src/k8s.io/apiserver/pkg/audit:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/github.com/google/uuid:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/plugin/pkg/audit/log/backend_test.go b/staging/src/k8s.io/apiserver/plugin/pkg/audit/log/backend_test.go index ed3369d72c8..b839d96c9e9 100644 --- a/staging/src/k8s.io/apiserver/plugin/pkg/audit/log/backend_test.go +++ b/staging/src/k8s.io/apiserver/plugin/pkg/audit/log/backend_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/pborman/uuid" + "github.com/google/uuid" authnv1 "k8s.io/api/authentication/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -48,7 +48,7 @@ func TestLogEventsLegacy(t *testing.T) { }{ { &auditinternal.Event{ - AuditID: types.UID(uuid.NewRandom().String()), + AuditID: types.UID(uuid.New().String()), }, `[\d\:\-\.\+TZ]+ AUDIT: id="[\w-]+" stage="" ip="" method="" user="" groups="" as="" asgroups="" namespace="" uri="" response=""`, }, @@ -62,7 +62,7 @@ func TestLogEventsLegacy(t *testing.T) { "127.0.0.1", }, RequestReceivedTimestamp: metav1.NewMicroTime(time.Now()), - AuditID: types.UID(uuid.NewRandom().String()), + AuditID: types.UID(uuid.New().String()), Stage: auditinternal.StageRequestReceived, Verb: "get", User: authnv1.UserInfo{ @@ -80,7 +80,7 @@ func TestLogEventsLegacy(t *testing.T) { }, { &auditinternal.Event{ - AuditID: types.UID(uuid.NewRandom().String()), + AuditID: types.UID(uuid.New().String()), Level: auditinternal.LevelMetadata, ObjectRef: &auditinternal.ObjectReference{ Resource: "foo", @@ -108,7 +108,7 @@ func TestLogEventsLegacy(t *testing.T) { func TestLogEventsJson(t *testing.T) { for _, event := range []*auditinternal.Event{ { - AuditID: types.UID(uuid.NewRandom().String()), + AuditID: types.UID(uuid.New().String()), }, { ResponseStatus: &metav1.Status{ @@ -120,7 +120,7 @@ func TestLogEventsJson(t *testing.T) { }, RequestReceivedTimestamp: metav1.NewMicroTime(time.Now().Truncate(time.Microsecond)), StageTimestamp: metav1.NewMicroTime(time.Now().Truncate(time.Microsecond)), - AuditID: types.UID(uuid.NewRandom().String()), + AuditID: types.UID(uuid.New().String()), Stage: auditinternal.StageRequestReceived, Verb: "get", User: authnv1.UserInfo{ @@ -135,7 +135,7 @@ func TestLogEventsJson(t *testing.T) { }, }, { - AuditID: types.UID(uuid.NewRandom().String()), + AuditID: types.UID(uuid.New().String()), Level: auditinternal.LevelMetadata, ObjectRef: &auditinternal.ObjectReference{ Resource: "foo", diff --git a/test/e2e_node/runner/remote/BUILD b/test/e2e_node/runner/remote/BUILD index 984713f2698..c10690da92a 100644 --- a/test/e2e_node/runner/remote/BUILD +++ b/test/e2e_node/runner/remote/BUILD @@ -18,7 +18,7 @@ go_library( deps = [ "//test/e2e_node/remote:go_default_library", "//test/e2e_node/system:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/github.com/google/uuid:go_default_library", "//vendor/golang.org/x/oauth2/google:go_default_library", "//vendor/google.golang.org/api/compute/v0.beta:go_default_library", "//vendor/google.golang.org/api/option:go_default_library", diff --git a/test/e2e_node/runner/remote/run_remote.go b/test/e2e_node/runner/remote/run_remote.go index 5194bd8982a..8459f045e1f 100644 --- a/test/e2e_node/runner/remote/run_remote.go +++ b/test/e2e_node/runner/remote/run_remote.go @@ -39,7 +39,7 @@ import ( "k8s.io/kubernetes/test/e2e_node/remote" "k8s.io/kubernetes/test/e2e_node/system" - "github.com/pborman/uuid" + "github.com/google/uuid" "golang.org/x/oauth2/google" compute "google.golang.org/api/compute/v0.beta" "google.golang.org/api/option" @@ -300,7 +300,7 @@ func main() { } } if *instanceNamePrefix == "" { - *instanceNamePrefix = "tmp-node-e2e-" + uuid.NewUUID().String()[:8] + *instanceNamePrefix = "tmp-node-e2e-" + uuid.New().String()[:8] } // Setup coloring @@ -785,7 +785,7 @@ func imageToInstanceName(imageConfig *internalGCEImage) string { } // For benchmark test, node name has the format 'machine-image-uuid' to run // different machine types with the same image in parallel - return imageConfig.machine + "-" + imageConfig.image + "-" + uuid.NewUUID().String()[:8] + return imageConfig.machine + "-" + imageConfig.image + "-" + uuid.New().String()[:8] } func sourceImage(image, imageProject string) string { diff --git a/test/integration/apiserver/BUILD b/test/integration/apiserver/BUILD index 2834b5631f6..5230279ee22 100644 --- a/test/integration/apiserver/BUILD +++ b/test/integration/apiserver/BUILD @@ -71,7 +71,7 @@ go_test( "//staging/src/k8s.io/component-base/featuregate/testing:go_default_library", "//staging/src/k8s.io/kubectl/pkg/cmd/util:go_default_library", "//test/integration/framework:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/github.com/google/uuid:go_default_library", "//vendor/k8s.io/gengo/examples/set-gen/sets:go_default_library", "//vendor/k8s.io/klog:go_default_library", ], diff --git a/test/integration/apiserver/patch_test.go b/test/integration/apiserver/patch_test.go index 13640b54c16..6216d5ad842 100644 --- a/test/integration/apiserver/patch_test.go +++ b/test/integration/apiserver/patch_test.go @@ -22,7 +22,7 @@ import ( "sync/atomic" "testing" - "github.com/pborman/uuid" + "github.com/google/uuid" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -45,7 +45,7 @@ func TestPatchConflicts(t *testing.T) { UIDs := make([]types.UID, numOfConcurrentPatches) ownerRefs := []metav1.OwnerReference{} for i := 0; i < numOfConcurrentPatches; i++ { - uid := types.UID(uuid.NewRandom().String()) + uid := types.UID(uuid.New().String()) ownerName := fmt.Sprintf("owner-%d", i) UIDs[i] = uid ownerRefs = append(ownerRefs, metav1.OwnerReference{ @@ -76,7 +76,7 @@ func TestPatchConflicts(t *testing.T) { go func(i int) { defer wg.Done() labelName := fmt.Sprintf("label-%d", i) - value := uuid.NewRandom().String() + value := uuid.New().String() obj, err := client.Patch(types.StrategicMergePatchType). Namespace(ns.Name). diff --git a/test/integration/framework/BUILD b/test/integration/framework/BUILD index f32937876a9..b6102758031 100644 --- a/test/integration/framework/BUILD +++ b/test/integration/framework/BUILD @@ -70,7 +70,7 @@ go_library( "//test/e2e/framework/node:go_default_library", "//test/utils:go_default_library", "//vendor/github.com/go-openapi/spec:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/github.com/google/uuid:go_default_library", "//vendor/go.etcd.io/etcd/clientv3:go_default_library", "//vendor/google.golang.org/grpc/grpclog:go_default_library", "//vendor/k8s.io/klog:go_default_library", diff --git a/test/integration/framework/master_utils.go b/test/integration/framework/master_utils.go index a3feb222ec5..dbc8a806598 100644 --- a/test/integration/framework/master_utils.go +++ b/test/integration/framework/master_utils.go @@ -27,7 +27,7 @@ import ( "time" "github.com/go-openapi/spec" - "github.com/pborman/uuid" + "github.com/google/uuid" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/wait" authauthenticator "k8s.io/apiserver/pkg/authentication/authenticator" @@ -157,12 +157,12 @@ func startMasterOrDie(masterConfig *master.Config, incomingServer *httptest.Serv } masterConfig.GenericConfig.LoopbackClientConfig.Host = s.URL - privilegedLoopbackToken := uuid.NewRandom().String() + privilegedLoopbackToken := uuid.New().String() // wrap any available authorizer tokens := make(map[string]*user.DefaultInfo) tokens[privilegedLoopbackToken] = &user.DefaultInfo{ Name: user.APIServerUser, - UID: uuid.NewRandom().String(), + UID: uuid.New().String(), Groups: []string{user.SystemPrivilegedGroup}, } @@ -260,7 +260,7 @@ func DefaultEtcdOptions() *options.EtcdOptions { // This causes the integration tests to exercise the etcd // prefix code, so please don't change without ensuring // sufficient coverage in other ways. - etcdOptions := options.NewEtcdOptions(storagebackend.NewDefaultConfig(uuid.New(), nil)) + etcdOptions := options.NewEtcdOptions(storagebackend.NewDefaultConfig(uuid.New().String(), nil)) etcdOptions.StorageConfig.Transport.ServerList = []string{GetEtcdURL()} return etcdOptions } @@ -332,7 +332,7 @@ func RunAMasterUsingServer(masterConfig *master.Config, s *httptest.Server, mast // SharedEtcd creates a storage config for a shared etcd instance, with a unique prefix. func SharedEtcd() *storagebackend.Config { - cfg := storagebackend.NewDefaultConfig(path.Join(uuid.New(), "registry"), nil) + cfg := storagebackend.NewDefaultConfig(path.Join(uuid.New().String(), "registry"), nil) cfg.Transport.ServerList = []string{GetEtcdURL()} return cfg } diff --git a/test/integration/framework/test_server.go b/test/integration/framework/test_server.go index c0f15e75972..c9106a6ccac 100644 --- a/test/integration/framework/test_server.go +++ b/test/integration/framework/test_server.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/pborman/uuid" + "github.com/google/uuid" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" @@ -90,7 +90,7 @@ func StartTestServer(t *testing.T, stopCh <-chan struct{}, setup TestServerSetup kubeAPIServerOptions.SecureServing.BindAddress = net.ParseIP("127.0.0.1") kubeAPIServerOptions.SecureServing.ServerCert.CertDirectory = certDir kubeAPIServerOptions.InsecureServing.BindPort = 0 - kubeAPIServerOptions.Etcd.StorageConfig.Prefix = path.Join("/", uuid.New(), "registry") + kubeAPIServerOptions.Etcd.StorageConfig.Prefix = path.Join("/", uuid.New().String(), "registry") kubeAPIServerOptions.Etcd.StorageConfig.Transport.ServerList = []string{GetEtcdURL()} kubeAPIServerOptions.ServiceClusterIPRanges = defaultServiceClusterIPRange.String() kubeAPIServerOptions.Authentication.RequestHeader.UsernameHeaders = []string{"X-Remote-User"}