migrate callers to g/g/uuid

This commit is contained in:
Mike Danese 2019-11-04 23:15:20 -08:00
parent 590cbef0f6
commit a4ca9e6c93
25 changed files with 50 additions and 48 deletions

View File

@ -23,7 +23,7 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_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/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/cloud-provider/volume/helpers: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/github.com/quobyte/api:go_default_library",
"//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/klog:go_default_library",
"//vendor/k8s.io/utils/strings:go_default_library", "//vendor/k8s.io/utils/strings:go_default_library",

View File

@ -22,7 +22,7 @@ import (
"path/filepath" "path/filepath"
gostrings "strings" gostrings "strings"
"github.com/pborman/uuid" "github.com/google/uuid"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -408,7 +408,7 @@ func (provisioner *quobyteVolumeProvisioner) Provision(selectedNode *v1.Node, al
} }
// create random image name // 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{ manager := &quobyteVolumeManager{
config: cfg, config: cfg,

View File

@ -13,6 +13,7 @@ require (
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
github.com/google/go-cmp v0.3.0 github.com/google/go-cmp v0.3.0
github.com/google/gofuzz v1.0.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/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d
github.com/pborman/uuid v1.2.0 github.com/pborman/uuid v1.2.0
github.com/spf13/cobra v0.0.5 github.com/spf13/cobra v0.0.5

View File

@ -31,7 +31,7 @@ go_library(
"//staging/src/k8s.io/client-go/rest:go_default_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/restmapper:go_default_library",
"//staging/src/k8s.io/client-go/scale: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", "//vendor/k8s.io/utils/pointer:go_default_library",
], ],
) )

View File

@ -21,7 +21,7 @@ import (
"os" "os"
"strings" "strings"
"github.com/pborman/uuid" "github.com/google/uuid"
"k8s.io/apiextensions-apiserver/pkg/cmd/server/options" "k8s.io/apiextensions-apiserver/pkg/cmd/server/options"
"k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
@ -59,7 +59,7 @@ users:
fakeKubeConfig.Close() fakeKubeConfig.Close()
s, err := servertesting.StartTestServer(t, nil, append([]string{ s, err := servertesting.StartTestServer(t, nil, append([]string{
"--etcd-prefix", uuid.New(), "--etcd-prefix", uuid.New().String(),
"--etcd-servers", strings.Join(IntegrationEtcdServers(), ","), "--etcd-servers", strings.Join(IntegrationEtcdServers(), ","),
"--authentication-skip-lookup", "--authentication-skip-lookup",
"--authentication-kubeconfig", fakeKubeConfig.Name(), "--authentication-kubeconfig", fakeKubeConfig.Name(),

View File

@ -19,6 +19,7 @@ require (
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
github.com/google/go-cmp v0.3.0 github.com/google/go-cmp v0.3.0
github.com/google/gofuzz v1.0.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/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d
github.com/gorilla/websocket v1.4.0 // indirect github.com/gorilla/websocket v1.4.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0

View File

@ -37,7 +37,7 @@ go_library(
"//staging/src/k8s.io/apiserver/pkg/authorization/authorizer:go_default_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:go_default_library",
"//staging/src/k8s.io/component-base/metrics/legacyregistry: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", "//vendor/k8s.io/klog:go_default_library",
], ],
) )

View File

@ -23,7 +23,7 @@ import (
"reflect" "reflect"
"time" "time"
"github.com/pborman/uuid" "github.com/google/uuid"
"k8s.io/klog" "k8s.io/klog"
authnv1 "k8s.io/api/authentication/v1" authnv1 "k8s.io/api/authentication/v1"
@ -58,7 +58,7 @@ func NewEventFromRequest(req *http.Request, level auditinternal.Level, attribs a
if ids != "" { if ids != "" {
ev.AuditID = types.UID(ids) ev.AuditID = types.UID(ids)
} else { } else {
ev.AuditID = types.UID(uuid.NewRandom().String()) ev.AuditID = types.UID(uuid.New().String())
} }
ips := utilnet.SourceIPs(req) ips := utilnet.SourceIPs(req)

View File

@ -18,7 +18,7 @@ go_test(
"//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library", "//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/authenticator:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/authentication/user: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",
], ],
) )

View File

@ -21,7 +21,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/pborman/uuid" "github.com/google/uuid"
"k8s.io/apimachinery/pkg/util/clock" "k8s.io/apimachinery/pkg/util/clock"
"k8s.io/apiserver/pkg/authentication/authenticator" "k8s.io/apiserver/pkg/authentication/authenticator"
@ -50,7 +50,7 @@ func BenchmarkStripedCache(b *testing.B) {
func benchmarkCache(cache cache, b *testing.B) { func benchmarkCache(cache cache, b *testing.B) {
keys := []string{} keys := []string{}
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
key := uuid.NewRandom().String() key := uuid.New().String()
keys = append(keys, key) keys = append(keys, key)
} }

View File

@ -33,7 +33,7 @@ go_test(
"//staging/src/k8s.io/apiserver/pkg/authentication/user:go_default_library", "//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/authorization/authorizer:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/endpoints/request: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", "//vendor/github.com/stretchr/testify/assert:go_default_library",
], ],
) )

View File

@ -26,7 +26,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/pborman/uuid" "github.com/google/uuid"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
@ -223,7 +223,7 @@ func TestAudit(t *testing.T) {
"short running with auditID", "short running with auditID",
shortRunningPath, shortRunningPath,
"GET", "GET",
uuid.NewRandom().String(), uuid.New().String(),
nil, nil,
func(w http.ResponseWriter, req *http.Request) { func(w http.ResponseWriter, req *http.Request) {
w.Write([]byte("foo")) w.Write([]byte("foo"))
@ -422,7 +422,7 @@ func TestAudit(t *testing.T) {
"empty longrunning with audit id", "empty longrunning with audit id",
longRunningPath, longRunningPath,
"GET", "GET",
uuid.NewRandom().String(), uuid.New().String(),
nil, nil,
func(w http.ResponseWriter, req *http.Request) { func(w http.ResponseWriter, req *http.Request) {
w.Write([]byte("foo")) 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", "no http header when there is no audit even the request header specified",
uuid.NewRandom().String(), uuid.New().String(),
auditinternal.LevelNone, auditinternal.LevelNone,
false, false,
}, },
@ -790,7 +790,7 @@ func TestAuditIDHttpHeader(t *testing.T) {
}, },
{ {
"user provided header", "user provided header",
uuid.NewRandom().String(), uuid.New().String(),
auditinternal.LevelRequestResponse, auditinternal.LevelRequestResponse,
true, true,
}, },

View File

@ -113,7 +113,7 @@ go_library(
"//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library",
"//vendor/github.com/evanphx/json-patch:go_default_library", "//vendor/github.com/evanphx/json-patch:go_default_library",
"//vendor/github.com/go-openapi/spec: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/golang.org/x/net/http2:go_default_library",
"//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/klog:go_default_library",
"//vendor/k8s.io/kube-openapi/pkg/builder:go_default_library", "//vendor/k8s.io/kube-openapi/pkg/builder:go_default_library",

View File

@ -30,7 +30,7 @@ import (
jsonpatch "github.com/evanphx/json-patch" jsonpatch "github.com/evanphx/json-patch"
"github.com/go-openapi/spec" "github.com/go-openapi/spec"
"github.com/pborman/uuid" "github.com/google/uuid"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
@ -727,7 +727,7 @@ func AuthorizeClientBearerToken(loopback *restclient.Config, authn *Authenticati
} }
privilegedLoopbackToken := loopback.BearerToken privilegedLoopbackToken := loopback.BearerToken
var uid = uuid.NewRandom().String() var uid = uuid.New().String()
tokens := make(map[string]*user.DefaultInfo) tokens := make(map[string]*user.DefaultInfo)
tokens[privilegedLoopbackToken] = &user.DefaultInfo{ tokens[privilegedLoopbackToken] = &user.DefaultInfo{
Name: user.APIServerUser, Name: user.APIServerUser,

View File

@ -82,7 +82,7 @@ go_library(
"//staging/src/k8s.io/client-go/util/cert:go_default_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/client-go/util/keyutil:go_default_library",
"//staging/src/k8s.io/component-base/cli/flag: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/github.com/spf13/pflag:go_default_library",
"//vendor/gopkg.in/natefinch/lumberjack.v2:go_default_library", "//vendor/gopkg.in/natefinch/lumberjack.v2:go_default_library",
"//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/klog:go_default_library",

View File

@ -19,7 +19,7 @@ package options
import ( import (
"fmt" "fmt"
"github.com/pborman/uuid" "github.com/google/uuid"
"k8s.io/apiserver/pkg/server" "k8s.io/apiserver/pkg/server"
"k8s.io/apiserver/pkg/server/dynamiccertificates" "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) 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 { switch {
// if we failed and there's no fallback loopback client config, we need to fail // if we failed and there's no fallback loopback client config, we need to fail
case err != nil && *loopbackClientConfig == nil: case err != nil && *loopbackClientConfig == nil:

View File

@ -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/v1:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1: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", "//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",
], ],
) )

View File

@ -23,7 +23,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/pborman/uuid" "github.com/google/uuid"
authnv1 "k8s.io/api/authentication/v1" authnv1 "k8s.io/api/authentication/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -48,7 +48,7 @@ func TestLogEventsLegacy(t *testing.T) {
}{ }{
{ {
&auditinternal.Event{ &auditinternal.Event{
AuditID: types.UID(uuid.NewRandom().String()), AuditID: types.UID(uuid.New().String()),
}, },
`[\d\:\-\.\+TZ]+ AUDIT: id="[\w-]+" stage="" ip="<unknown>" method="" user="<none>" groups="<none>" as="<self>" asgroups="<lookup>" namespace="<none>" uri="" response="<deferred>"`, `[\d\:\-\.\+TZ]+ AUDIT: id="[\w-]+" stage="" ip="<unknown>" method="" user="<none>" groups="<none>" as="<self>" asgroups="<lookup>" namespace="<none>" uri="" response="<deferred>"`,
}, },
@ -62,7 +62,7 @@ func TestLogEventsLegacy(t *testing.T) {
"127.0.0.1", "127.0.0.1",
}, },
RequestReceivedTimestamp: metav1.NewMicroTime(time.Now()), RequestReceivedTimestamp: metav1.NewMicroTime(time.Now()),
AuditID: types.UID(uuid.NewRandom().String()), AuditID: types.UID(uuid.New().String()),
Stage: auditinternal.StageRequestReceived, Stage: auditinternal.StageRequestReceived,
Verb: "get", Verb: "get",
User: authnv1.UserInfo{ User: authnv1.UserInfo{
@ -80,7 +80,7 @@ func TestLogEventsLegacy(t *testing.T) {
}, },
{ {
&auditinternal.Event{ &auditinternal.Event{
AuditID: types.UID(uuid.NewRandom().String()), AuditID: types.UID(uuid.New().String()),
Level: auditinternal.LevelMetadata, Level: auditinternal.LevelMetadata,
ObjectRef: &auditinternal.ObjectReference{ ObjectRef: &auditinternal.ObjectReference{
Resource: "foo", Resource: "foo",
@ -108,7 +108,7 @@ func TestLogEventsLegacy(t *testing.T) {
func TestLogEventsJson(t *testing.T) { func TestLogEventsJson(t *testing.T) {
for _, event := range []*auditinternal.Event{ for _, event := range []*auditinternal.Event{
{ {
AuditID: types.UID(uuid.NewRandom().String()), AuditID: types.UID(uuid.New().String()),
}, },
{ {
ResponseStatus: &metav1.Status{ ResponseStatus: &metav1.Status{
@ -120,7 +120,7 @@ func TestLogEventsJson(t *testing.T) {
}, },
RequestReceivedTimestamp: metav1.NewMicroTime(time.Now().Truncate(time.Microsecond)), RequestReceivedTimestamp: metav1.NewMicroTime(time.Now().Truncate(time.Microsecond)),
StageTimestamp: 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, Stage: auditinternal.StageRequestReceived,
Verb: "get", Verb: "get",
User: authnv1.UserInfo{ 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, Level: auditinternal.LevelMetadata,
ObjectRef: &auditinternal.ObjectReference{ ObjectRef: &auditinternal.ObjectReference{
Resource: "foo", Resource: "foo",

View File

@ -18,7 +18,7 @@ go_library(
deps = [ deps = [
"//test/e2e_node/remote:go_default_library", "//test/e2e_node/remote:go_default_library",
"//test/e2e_node/system: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/golang.org/x/oauth2/google:go_default_library",
"//vendor/google.golang.org/api/compute/v0.beta:go_default_library", "//vendor/google.golang.org/api/compute/v0.beta:go_default_library",
"//vendor/google.golang.org/api/option:go_default_library", "//vendor/google.golang.org/api/option:go_default_library",

View File

@ -39,7 +39,7 @@ import (
"k8s.io/kubernetes/test/e2e_node/remote" "k8s.io/kubernetes/test/e2e_node/remote"
"k8s.io/kubernetes/test/e2e_node/system" "k8s.io/kubernetes/test/e2e_node/system"
"github.com/pborman/uuid" "github.com/google/uuid"
"golang.org/x/oauth2/google" "golang.org/x/oauth2/google"
compute "google.golang.org/api/compute/v0.beta" compute "google.golang.org/api/compute/v0.beta"
"google.golang.org/api/option" "google.golang.org/api/option"
@ -300,7 +300,7 @@ func main() {
} }
} }
if *instanceNamePrefix == "" { if *instanceNamePrefix == "" {
*instanceNamePrefix = "tmp-node-e2e-" + uuid.NewUUID().String()[:8] *instanceNamePrefix = "tmp-node-e2e-" + uuid.New().String()[:8]
} }
// Setup coloring // Setup coloring
@ -785,7 +785,7 @@ func imageToInstanceName(imageConfig *internalGCEImage) string {
} }
// For benchmark test, node name has the format 'machine-image-uuid' to run // For benchmark test, node name has the format 'machine-image-uuid' to run
// different machine types with the same image in parallel // 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 { func sourceImage(image, imageProject string) string {

View File

@ -71,7 +71,7 @@ go_test(
"//staging/src/k8s.io/component-base/featuregate/testing:go_default_library", "//staging/src/k8s.io/component-base/featuregate/testing:go_default_library",
"//staging/src/k8s.io/kubectl/pkg/cmd/util:go_default_library", "//staging/src/k8s.io/kubectl/pkg/cmd/util:go_default_library",
"//test/integration/framework: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/gengo/examples/set-gen/sets:go_default_library",
"//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/klog:go_default_library",
], ],

View File

@ -22,7 +22,7 @@ import (
"sync/atomic" "sync/atomic"
"testing" "testing"
"github.com/pborman/uuid" "github.com/google/uuid"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/errors"
@ -45,7 +45,7 @@ func TestPatchConflicts(t *testing.T) {
UIDs := make([]types.UID, numOfConcurrentPatches) UIDs := make([]types.UID, numOfConcurrentPatches)
ownerRefs := []metav1.OwnerReference{} ownerRefs := []metav1.OwnerReference{}
for i := 0; i < numOfConcurrentPatches; i++ { for i := 0; i < numOfConcurrentPatches; i++ {
uid := types.UID(uuid.NewRandom().String()) uid := types.UID(uuid.New().String())
ownerName := fmt.Sprintf("owner-%d", i) ownerName := fmt.Sprintf("owner-%d", i)
UIDs[i] = uid UIDs[i] = uid
ownerRefs = append(ownerRefs, metav1.OwnerReference{ ownerRefs = append(ownerRefs, metav1.OwnerReference{
@ -76,7 +76,7 @@ func TestPatchConflicts(t *testing.T) {
go func(i int) { go func(i int) {
defer wg.Done() defer wg.Done()
labelName := fmt.Sprintf("label-%d", i) labelName := fmt.Sprintf("label-%d", i)
value := uuid.NewRandom().String() value := uuid.New().String()
obj, err := client.Patch(types.StrategicMergePatchType). obj, err := client.Patch(types.StrategicMergePatchType).
Namespace(ns.Name). Namespace(ns.Name).

View File

@ -70,7 +70,7 @@ go_library(
"//test/e2e/framework/node:go_default_library", "//test/e2e/framework/node:go_default_library",
"//test/utils:go_default_library", "//test/utils:go_default_library",
"//vendor/github.com/go-openapi/spec: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/go.etcd.io/etcd/clientv3:go_default_library",
"//vendor/google.golang.org/grpc/grpclog:go_default_library", "//vendor/google.golang.org/grpc/grpclog:go_default_library",
"//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/klog:go_default_library",

View File

@ -27,7 +27,7 @@ import (
"time" "time"
"github.com/go-openapi/spec" "github.com/go-openapi/spec"
"github.com/pborman/uuid" "github.com/google/uuid"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/util/wait"
authauthenticator "k8s.io/apiserver/pkg/authentication/authenticator" 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 masterConfig.GenericConfig.LoopbackClientConfig.Host = s.URL
privilegedLoopbackToken := uuid.NewRandom().String() privilegedLoopbackToken := uuid.New().String()
// wrap any available authorizer // wrap any available authorizer
tokens := make(map[string]*user.DefaultInfo) tokens := make(map[string]*user.DefaultInfo)
tokens[privilegedLoopbackToken] = &user.DefaultInfo{ tokens[privilegedLoopbackToken] = &user.DefaultInfo{
Name: user.APIServerUser, Name: user.APIServerUser,
UID: uuid.NewRandom().String(), UID: uuid.New().String(),
Groups: []string{user.SystemPrivilegedGroup}, Groups: []string{user.SystemPrivilegedGroup},
} }
@ -260,7 +260,7 @@ func DefaultEtcdOptions() *options.EtcdOptions {
// This causes the integration tests to exercise the etcd // This causes the integration tests to exercise the etcd
// prefix code, so please don't change without ensuring // prefix code, so please don't change without ensuring
// sufficient coverage in other ways. // 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()} etcdOptions.StorageConfig.Transport.ServerList = []string{GetEtcdURL()}
return etcdOptions 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. // SharedEtcd creates a storage config for a shared etcd instance, with a unique prefix.
func SharedEtcd() *storagebackend.Config { 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()} cfg.Transport.ServerList = []string{GetEtcdURL()}
return cfg return cfg
} }

View File

@ -25,7 +25,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/pborman/uuid" "github.com/google/uuid"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait" "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.BindAddress = net.ParseIP("127.0.0.1")
kubeAPIServerOptions.SecureServing.ServerCert.CertDirectory = certDir kubeAPIServerOptions.SecureServing.ServerCert.CertDirectory = certDir
kubeAPIServerOptions.InsecureServing.BindPort = 0 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.Etcd.StorageConfig.Transport.ServerList = []string{GetEtcdURL()}
kubeAPIServerOptions.ServiceClusterIPRanges = defaultServiceClusterIPRange.String() kubeAPIServerOptions.ServiceClusterIPRanges = defaultServiceClusterIPRange.String()
kubeAPIServerOptions.Authentication.RequestHeader.UsernameHeaders = []string{"X-Remote-User"} kubeAPIServerOptions.Authentication.RequestHeader.UsernameHeaders = []string{"X-Remote-User"}