Commit 01cd7f32 authored by k8s-merge-robot's avatar k8s-merge-robot Committed by GitHub

Merge pull request #29621 from resouer/uuid

Automatic merge from submit-queue Refactor uuid into its own pkg util/uuid Continuing my work ref #15634 Anyone can review this if he/she wants.
parents 8913c375 c495397c
...@@ -20,7 +20,7 @@ import ( ...@@ -20,7 +20,7 @@ import (
"github.com/aws/aws-sdk-go/service/route53" "github.com/aws/aws-sdk-go/service/route53"
"k8s.io/kubernetes/federation/pkg/dnsprovider" "k8s.io/kubernetes/federation/pkg/dnsprovider"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
) )
// Compile time check for interface adeherence // Compile time check for interface adeherence
...@@ -48,7 +48,7 @@ func (zones Zones) List() ([]dnsprovider.Zone, error) { ...@@ -48,7 +48,7 @@ func (zones Zones) List() ([]dnsprovider.Zone, error) {
func (zones Zones) Add(zone dnsprovider.Zone) (dnsprovider.Zone, error) { func (zones Zones) Add(zone dnsprovider.Zone) (dnsprovider.Zone, error) {
dnsName := zone.Name() dnsName := zone.Name()
callerReference := string(util.NewUUID()) callerReference := string(uuid.NewUUID())
input := route53.CreateHostedZoneInput{Name: &dnsName, CallerReference: &callerReference} input := route53.CreateHostedZoneInput{Name: &dnsName, CallerReference: &callerReference}
output, err := zones.interface_.service.CreateHostedZone(&input) output, err := zones.interface_.service.CreateHostedZone(&input)
if err != nil { if err != nil {
...@@ -67,7 +67,7 @@ func (zones Zones) Remove(zone dnsprovider.Zone) error { ...@@ -67,7 +67,7 @@ func (zones Zones) Remove(zone dnsprovider.Zone) error {
return nil return nil
} }
func (zones Zones) New(name string) (dnsprovider.Zone, error) { func (zones Zones) New(name string) (dnsprovider.Zone, error) {
id := string(util.NewUUID()) id := string(uuid.NewUUID())
managedZone := route53.HostedZone{Id: &id, Name: &name} managedZone := route53.HostedZone{Id: &id, Name: &name}
return &Zone{&managedZone, &zones}, nil return &Zone{&managedZone, &zones}, nil
} }
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
dns "google.golang.org/api/dns/v1" dns "google.golang.org/api/dns/v1"
"k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
) )
// Compile time check for interface adeherence // Compile time check for interface adeherence
...@@ -46,6 +46,6 @@ func (m *ManagedZonesService) List(project string) interfaces.ManagedZonesListCa ...@@ -46,6 +46,6 @@ func (m *ManagedZonesService) List(project string) interfaces.ManagedZonesListCa
} }
func (m *ManagedZonesService) NewManagedZone(dnsName string) interfaces.ManagedZone { func (m *ManagedZonesService) NewManagedZone(dnsName string) interfaces.ManagedZone {
name := "x" + strings.Replace(string(util.NewUUID()), "-", "", -1)[0:30] // Unique name, strip out the "-" chars to shorten it, start with a lower case alpha, and truncate to Cloud DNS 32 character limit name := "x" + strings.Replace(string(uuid.NewUUID()), "-", "", -1)[0:30] // Unique name, strip out the "-" chars to shorten it, start with a lower case alpha, and truncate to Cloud DNS 32 character limit
return &ManagedZone{impl: &dns.ManagedZone{Name: name, Description: "Kubernetes Federated Service", DnsName: dnsName}} return &ManagedZone{impl: &dns.ManagedZone{Name: name, Description: "Kubernetes Federated Service", DnsName: dnsName}}
} }
...@@ -32,14 +32,14 @@ import ( ...@@ -32,14 +32,14 @@ import (
"k8s.io/kubernetes/pkg/client/restclient" "k8s.io/kubernetes/pkg/client/restclient"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd" "k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
clientcmdapi "k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api" clientcmdapi "k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
) )
func newCluster(clusterName string, serverUrl string) *federation_v1beta1.Cluster { func newCluster(clusterName string, serverUrl string) *federation_v1beta1.Cluster {
cluster := federation_v1beta1.Cluster{ cluster := federation_v1beta1.Cluster{
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()}, TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()},
ObjectMeta: v1.ObjectMeta{ ObjectMeta: v1.ObjectMeta{
UID: util.NewUUID(), UID: uuid.NewUUID(),
Name: clusterName, Name: clusterName,
}, },
Spec: federation_v1beta1.ClusterSpec{ Spec: federation_v1beta1.ClusterSpec{
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/conversion" "k8s.io/kubernetes/pkg/conversion"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
) )
// FillObjectMetaSystemFields populates fields that are managed by the system on ObjectMeta. // FillObjectMetaSystemFields populates fields that are managed by the system on ObjectMeta.
...@@ -33,7 +33,7 @@ func FillObjectMetaSystemFields(ctx Context, meta *ObjectMeta) { ...@@ -33,7 +33,7 @@ func FillObjectMetaSystemFields(ctx Context, meta *ObjectMeta) {
// to support tracking resources pending creation. // to support tracking resources pending creation.
uid, found := UIDFrom(ctx) uid, found := UIDFrom(ctx)
if !found { if !found {
uid = util.NewUUID() uid = uuid.NewUUID()
} }
meta.UID = uid meta.UID = uid
meta.SelfLink = "" meta.SelfLink = ""
......
...@@ -28,7 +28,7 @@ import ( ...@@ -28,7 +28,7 @@ import (
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
) )
var _ meta.Object = &api.ObjectMeta{} var _ meta.Object = &api.ObjectMeta{}
...@@ -44,7 +44,7 @@ func TestFillObjectMetaSystemFields(t *testing.T) { ...@@ -44,7 +44,7 @@ func TestFillObjectMetaSystemFields(t *testing.T) {
t.Errorf("resource.UID missing") t.Errorf("resource.UID missing")
} }
// verify we can inject a UID // verify we can inject a UID
uid := util.NewUUID() uid := uuid.NewUUID()
ctx = api.WithUID(ctx, uid) ctx = api.WithUID(ctx, uid)
resource = api.ObjectMeta{} resource = api.ObjectMeta{}
api.FillObjectMetaSystemFields(ctx, &resource) api.FillObjectMetaSystemFields(ctx, &resource)
......
...@@ -35,10 +35,10 @@ import ( ...@@ -35,10 +35,10 @@ import (
"k8s.io/kubernetes/pkg/client/restclient" "k8s.io/kubernetes/pkg/client/restclient"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/securitycontext" "k8s.io/kubernetes/pkg/securitycontext"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/clock" "k8s.io/kubernetes/pkg/util/clock"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
utiltesting "k8s.io/kubernetes/pkg/util/testing" utiltesting "k8s.io/kubernetes/pkg/util/testing"
"k8s.io/kubernetes/pkg/util/uuid"
) )
// NewFakeControllerExpectationsLookup creates a fake store for PodExpectations. // NewFakeControllerExpectationsLookup creates a fake store for PodExpectations.
...@@ -55,7 +55,7 @@ func newReplicationController(replicas int) *api.ReplicationController { ...@@ -55,7 +55,7 @@ func newReplicationController(replicas int) *api.ReplicationController {
rc := &api.ReplicationController{ rc := &api.ReplicationController{
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()}, TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()},
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
UID: util.NewUUID(), UID: uuid.NewUUID(),
Name: "foobar", Name: "foobar",
Namespace: api.NamespaceDefault, Namespace: api.NamespaceDefault,
ResourceVersion: "18", ResourceVersion: "18",
......
...@@ -29,8 +29,8 @@ import ( ...@@ -29,8 +29,8 @@ import (
"k8s.io/kubernetes/pkg/client/testing/core" "k8s.io/kubernetes/pkg/client/testing/core"
"k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/uuid"
) )
var ( var (
...@@ -90,7 +90,7 @@ func newDeployment(replicas int, revisionHistoryLimit *int) *exp.Deployment { ...@@ -90,7 +90,7 @@ func newDeployment(replicas int, revisionHistoryLimit *int) *exp.Deployment {
d := exp.Deployment{ d := exp.Deployment{
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()}, TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()},
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
UID: util.NewUUID(), UID: uuid.NewUUID(),
Name: "foobar", Name: "foobar",
Namespace: api.NamespaceDefault, Namespace: api.NamespaceDefault,
ResourceVersion: "18", ResourceVersion: "18",
......
...@@ -38,9 +38,9 @@ import ( ...@@ -38,9 +38,9 @@ import (
"k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/securitycontext" "k8s.io/kubernetes/pkg/securitycontext"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
utiltesting "k8s.io/kubernetes/pkg/util/testing" utiltesting "k8s.io/kubernetes/pkg/util/testing"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
) )
...@@ -60,7 +60,7 @@ func newReplicaSet(replicas int, selectorMap map[string]string) *extensions.Repl ...@@ -60,7 +60,7 @@ func newReplicaSet(replicas int, selectorMap map[string]string) *extensions.Repl
rs := &extensions.ReplicaSet{ rs := &extensions.ReplicaSet{
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()}, TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()},
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
UID: util.NewUUID(), UID: uuid.NewUUID(),
Name: "foobar", Name: "foobar",
Namespace: api.NamespaceDefault, Namespace: api.NamespaceDefault,
ResourceVersion: "18", ResourceVersion: "18",
...@@ -958,7 +958,7 @@ func TestOverlappingRSs(t *testing.T) { ...@@ -958,7 +958,7 @@ func TestOverlappingRSs(t *testing.T) {
for j := 1; j < 10; j++ { for j := 1; j < 10; j++ {
rsSpec := newReplicaSet(1, labelMap) rsSpec := newReplicaSet(1, labelMap)
rsSpec.CreationTimestamp = unversioned.Date(2014, time.December, j, 0, 0, 0, 0, time.Local) rsSpec.CreationTimestamp = unversioned.Date(2014, time.December, j, 0, 0, 0, 0, time.Local)
rsSpec.Name = string(util.NewUUID()) rsSpec.Name = string(uuid.NewUUID())
controllers = append(controllers, rsSpec) controllers = append(controllers, rsSpec)
} }
shuffledControllers := shuffle(controllers) shuffledControllers := shuffle(controllers)
...@@ -1083,7 +1083,7 @@ func TestDoNotPatchPodWithOtherControlRef(t *testing.T) { ...@@ -1083,7 +1083,7 @@ func TestDoNotPatchPodWithOtherControlRef(t *testing.T) {
rs := newReplicaSet(2, labelMap) rs := newReplicaSet(2, labelMap)
manager.rsStore.Store.Add(rs) manager.rsStore.Store.Add(rs)
var trueVar = true var trueVar = true
otherControllerReference := api.OwnerReference{UID: util.NewUUID(), APIVersion: "v1beta1", Kind: "ReplicaSet", Name: "AnotherRS", Controller: &trueVar} otherControllerReference := api.OwnerReference{UID: uuid.NewUUID(), APIVersion: "v1beta1", Kind: "ReplicaSet", Name: "AnotherRS", Controller: &trueVar}
// add to podStore a matching Pod controlled by another controller. Expect no patch. // add to podStore a matching Pod controlled by another controller. Expect no patch.
pod := newPod("pod", rs, api.PodRunning) pod := newPod("pod", rs, api.PodRunning)
pod.OwnerReferences = []api.OwnerReference{otherControllerReference} pod.OwnerReferences = []api.OwnerReference{otherControllerReference}
...@@ -1104,7 +1104,7 @@ func TestPatchPodWithOtherOwnerRef(t *testing.T) { ...@@ -1104,7 +1104,7 @@ func TestPatchPodWithOtherOwnerRef(t *testing.T) {
// add to podStore one more matching pod that doesn't have a controller // add to podStore one more matching pod that doesn't have a controller
// ref, but has an owner ref pointing to other object. Expect a patch to // ref, but has an owner ref pointing to other object. Expect a patch to
// take control of it. // take control of it.
unrelatedOwnerReference := api.OwnerReference{UID: util.NewUUID(), APIVersion: "batch/v1", Kind: "Job", Name: "Job"} unrelatedOwnerReference := api.OwnerReference{UID: uuid.NewUUID(), APIVersion: "batch/v1", Kind: "Job", Name: "Job"}
pod := newPod("pod", rs, api.PodRunning) pod := newPod("pod", rs, api.PodRunning)
pod.OwnerReferences = []api.OwnerReference{unrelatedOwnerReference} pod.OwnerReferences = []api.OwnerReference{unrelatedOwnerReference}
manager.podStore.Indexer.Add(pod) manager.podStore.Indexer.Add(pod)
......
...@@ -37,9 +37,9 @@ import ( ...@@ -37,9 +37,9 @@ import (
"k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/securitycontext" "k8s.io/kubernetes/pkg/securitycontext"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
utiltesting "k8s.io/kubernetes/pkg/util/testing" utiltesting "k8s.io/kubernetes/pkg/util/testing"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
) )
...@@ -59,7 +59,7 @@ func newReplicationController(replicas int) *api.ReplicationController { ...@@ -59,7 +59,7 @@ func newReplicationController(replicas int) *api.ReplicationController {
rc := &api.ReplicationController{ rc := &api.ReplicationController{
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()}, TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()},
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
UID: util.NewUUID(), UID: uuid.NewUUID(),
Name: "foobar", Name: "foobar",
Namespace: api.NamespaceDefault, Namespace: api.NamespaceDefault,
ResourceVersion: "18", ResourceVersion: "18",
...@@ -937,7 +937,7 @@ func TestOverlappingRCs(t *testing.T) { ...@@ -937,7 +937,7 @@ func TestOverlappingRCs(t *testing.T) {
for j := 1; j < 10; j++ { for j := 1; j < 10; j++ {
controllerSpec := newReplicationController(1) controllerSpec := newReplicationController(1)
controllerSpec.CreationTimestamp = unversioned.Date(2014, time.December, j, 0, 0, 0, 0, time.Local) controllerSpec.CreationTimestamp = unversioned.Date(2014, time.December, j, 0, 0, 0, 0, time.Local)
controllerSpec.Name = string(util.NewUUID()) controllerSpec.Name = string(uuid.NewUUID())
controllers = append(controllers, controllerSpec) controllers = append(controllers, controllerSpec)
} }
shuffledControllers := shuffle(controllers) shuffledControllers := shuffle(controllers)
...@@ -1145,7 +1145,7 @@ func TestDoNotPatchPodWithOtherControlRef(t *testing.T) { ...@@ -1145,7 +1145,7 @@ func TestDoNotPatchPodWithOtherControlRef(t *testing.T) {
rc := newReplicationController(2) rc := newReplicationController(2)
manager.rcStore.Indexer.Add(rc) manager.rcStore.Indexer.Add(rc)
var trueVar = true var trueVar = true
otherControllerReference := api.OwnerReference{UID: util.NewUUID(), APIVersion: "v1", Kind: "ReplicationController", Name: "AnotherRC", Controller: &trueVar} otherControllerReference := api.OwnerReference{UID: uuid.NewUUID(), APIVersion: "v1", Kind: "ReplicationController", Name: "AnotherRC", Controller: &trueVar}
// add to podStore a matching Pod controlled by another controller. Expect no patch. // add to podStore a matching Pod controlled by another controller. Expect no patch.
pod := newPod("pod", rc, api.PodRunning) pod := newPod("pod", rc, api.PodRunning)
pod.OwnerReferences = []api.OwnerReference{otherControllerReference} pod.OwnerReferences = []api.OwnerReference{otherControllerReference}
...@@ -1165,7 +1165,7 @@ func TestPatchPodWithOtherOwnerRef(t *testing.T) { ...@@ -1165,7 +1165,7 @@ func TestPatchPodWithOtherOwnerRef(t *testing.T) {
// add to podStore one more matching pod that doesn't have a controller // add to podStore one more matching pod that doesn't have a controller
// ref, but has an owner ref pointing to other object. Expect a patch to // ref, but has an owner ref pointing to other object. Expect a patch to
// take control of it. // take control of it.
unrelatedOwnerReference := api.OwnerReference{UID: util.NewUUID(), APIVersion: "batch/v1", Kind: "Job", Name: "Job"} unrelatedOwnerReference := api.OwnerReference{UID: uuid.NewUUID(), APIVersion: "batch/v1", Kind: "Job", Name: "Job"}
pod := newPod("pod", rc, api.PodRunning) pod := newPod("pod", rc, api.PodRunning)
pod.OwnerReferences = []api.OwnerReference{unrelatedOwnerReference} pod.OwnerReferences = []api.OwnerReference{unrelatedOwnerReference}
manager.podStore.Indexer.Add(pod) manager.podStore.Indexer.Add(pod)
......
...@@ -32,6 +32,7 @@ import ( ...@@ -32,6 +32,7 @@ import (
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util"
utilerrors "k8s.io/kubernetes/pkg/util/errors" utilerrors "k8s.io/kubernetes/pkg/util/errors"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
) )
...@@ -290,7 +291,7 @@ func (reaper *DaemonSetReaper) Stop(namespace, name string, timeout time.Duratio ...@@ -290,7 +291,7 @@ func (reaper *DaemonSetReaper) Stop(namespace, name string, timeout time.Duratio
// daemon pods. Once it's done deleting the daemon pods, it's safe to delete // daemon pods. Once it's done deleting the daemon pods, it's safe to delete
// the DaemonSet. // the DaemonSet.
ds.Spec.Template.Spec.NodeSelector = map[string]string{ ds.Spec.Template.Spec.NodeSelector = map[string]string{
string(util.NewUUID()): string(util.NewUUID()), string(uuid.NewUUID()): string(uuid.NewUUID()),
} }
// force update to avoid version conflict // force update to avoid version conflict
ds.ResourceVersion = "" ds.ResourceVersion = ""
......
...@@ -35,9 +35,9 @@ import ( ...@@ -35,9 +35,9 @@ import (
"k8s.io/kubernetes/pkg/client/testing/core" "k8s.io/kubernetes/pkg/client/testing/core"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/diff" "k8s.io/kubernetes/pkg/util/diff"
"k8s.io/kubernetes/pkg/util/rand" "k8s.io/kubernetes/pkg/util/rand"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/version" "k8s.io/kubernetes/pkg/version"
) )
...@@ -48,7 +48,7 @@ func generateTestingImageList(count int) ([]kubecontainer.Image, []api.Container ...@@ -48,7 +48,7 @@ func generateTestingImageList(count int) ([]kubecontainer.Image, []api.Container
var imageList []kubecontainer.Image var imageList []kubecontainer.Image
for ; count > 0; count-- { for ; count > 0; count-- {
imageItem := kubecontainer.Image{ imageItem := kubecontainer.Image{
ID: string(util.NewUUID()), ID: string(uuid.NewUUID()),
RepoTags: generateImageTags(), RepoTags: generateImageTags(),
Size: rand.Int63nRange(minImgSize, maxImgSize+1), Size: rand.Int63nRange(minImgSize, maxImgSize+1),
} }
......
...@@ -56,13 +56,13 @@ import ( ...@@ -56,13 +56,13 @@ import (
"k8s.io/kubernetes/pkg/kubelet/util/format" "k8s.io/kubernetes/pkg/kubelet/util/format"
"k8s.io/kubernetes/pkg/securitycontext" "k8s.io/kubernetes/pkg/securitycontext"
kubetypes "k8s.io/kubernetes/pkg/types" kubetypes "k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/errors" "k8s.io/kubernetes/pkg/util/errors"
utilexec "k8s.io/kubernetes/pkg/util/exec" utilexec "k8s.io/kubernetes/pkg/util/exec"
"k8s.io/kubernetes/pkg/util/flowcontrol" "k8s.io/kubernetes/pkg/util/flowcontrol"
"k8s.io/kubernetes/pkg/util/selinux" "k8s.io/kubernetes/pkg/util/selinux"
utilstrings "k8s.io/kubernetes/pkg/util/strings" utilstrings "k8s.io/kubernetes/pkg/util/strings"
"k8s.io/kubernetes/pkg/util/term" "k8s.io/kubernetes/pkg/util/term"
"k8s.io/kubernetes/pkg/util/uuid"
utilwait "k8s.io/kubernetes/pkg/util/wait" utilwait "k8s.io/kubernetes/pkg/util/wait"
) )
...@@ -726,7 +726,7 @@ func (r *Runtime) makeContainerLogMount(opts *kubecontainer.RunContainerOptions, ...@@ -726,7 +726,7 @@ func (r *Runtime) makeContainerLogMount(opts *kubecontainer.RunContainerOptions,
// the container is launched, so here we generate a random uuid to enable // the container is launched, so here we generate a random uuid to enable
// us to map a container's termination message path to an unique log file // us to map a container's termination message path to an unique log file
// on the disk. // on the disk.
randomUID := util.NewUUID() randomUID := uuid.NewUUID()
containerLogPath := path.Join(opts.PodContainerDir, string(randomUID)) containerLogPath := path.Join(opts.PodContainerDir, string(randomUID))
fs, err := r.os.Create(containerLogPath) fs, err := r.os.Create(containerLogPath)
if err != nil { if err != nil {
......
...@@ -25,7 +25,7 @@ import ( ...@@ -25,7 +25,7 @@ import (
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/registry/generic" "k8s.io/kubernetes/pkg/registry/generic"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/validation/field" "k8s.io/kubernetes/pkg/util/validation/field"
) )
...@@ -45,7 +45,7 @@ func (limitrangeStrategy) NamespaceScoped() bool { ...@@ -45,7 +45,7 @@ func (limitrangeStrategy) NamespaceScoped() bool {
func (limitrangeStrategy) PrepareForCreate(obj runtime.Object) { func (limitrangeStrategy) PrepareForCreate(obj runtime.Object) {
limitRange := obj.(*api.LimitRange) limitRange := obj.(*api.LimitRange)
if len(limitRange.Name) == 0 { if len(limitRange.Name) == 0 {
limitRange.Name = string(util.NewUUID()) limitRange.Name = string(uuid.NewUUID())
} }
} }
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package util package uuid
import ( import (
"sync" "sync"
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume"
) )
...@@ -262,7 +262,7 @@ type hostPathProvisioner struct { ...@@ -262,7 +262,7 @@ type hostPathProvisioner struct {
// Create for hostPath simply creates a local /tmp/hostpath_pv/%s directory as a new PersistentVolume. // Create for hostPath simply creates a local /tmp/hostpath_pv/%s directory as a new PersistentVolume.
// This Provisioner is meant for development and testing only and WILL NOT WORK in a multi-node cluster. // This Provisioner is meant for development and testing only and WILL NOT WORK in a multi-node cluster.
func (r *hostPathProvisioner) Provision() (*api.PersistentVolume, error) { func (r *hostPathProvisioner) Provision() (*api.PersistentVolume, error) {
fullpath := fmt.Sprintf("/tmp/hostpath_pv/%s", util.NewUUID()) fullpath := fmt.Sprintf("/tmp/hostpath_pv/%s", uuid.NewUUID())
pv := &api.PersistentVolume{ pv := &api.PersistentVolume{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
......
...@@ -28,6 +28,7 @@ import ( ...@@ -28,6 +28,7 @@ import (
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/fake" "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/fake"
"k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume"
volumetest "k8s.io/kubernetes/pkg/volume/testing" volumetest "k8s.io/kubernetes/pkg/volume/testing"
) )
...@@ -91,7 +92,7 @@ func TestRecycler(t *testing.T) { ...@@ -91,7 +92,7 @@ func TestRecycler(t *testing.T) {
func TestDeleter(t *testing.T) { func TestDeleter(t *testing.T) {
// Deleter has a hard-coded regex for "/tmp". // Deleter has a hard-coded regex for "/tmp".
tempPath := fmt.Sprintf("/tmp/hostpath/%s", util.NewUUID()) tempPath := fmt.Sprintf("/tmp/hostpath/%s", uuid.NewUUID())
defer os.RemoveAll(tempPath) defer os.RemoveAll(tempPath)
err := os.MkdirAll(tempPath, 0750) err := os.MkdirAll(tempPath, 0750)
if err != nil { if err != nil {
...@@ -148,7 +149,7 @@ func TestDeleterTempDir(t *testing.T) { ...@@ -148,7 +149,7 @@ func TestDeleterTempDir(t *testing.T) {
} }
func TestProvisioner(t *testing.T) { func TestProvisioner(t *testing.T) {
tempPath := fmt.Sprintf("/tmp/hostpath/%s", util.NewUUID()) tempPath := fmt.Sprintf("/tmp/hostpath/%s", uuid.NewUUID())
defer os.RemoveAll(tempPath) defer os.RemoveAll(tempPath)
err := os.MkdirAll(tempPath, 0750) err := os.MkdirAll(tempPath, 0750)
......
...@@ -32,11 +32,11 @@ import ( ...@@ -32,11 +32,11 @@ import (
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
"k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/cloudprovider"
"k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/io" "k8s.io/kubernetes/pkg/util/io"
"k8s.io/kubernetes/pkg/util/mount" "k8s.io/kubernetes/pkg/util/mount"
utilstrings "k8s.io/kubernetes/pkg/util/strings" utilstrings "k8s.io/kubernetes/pkg/util/strings"
utiltesting "k8s.io/kubernetes/pkg/util/testing" utiltesting "k8s.io/kubernetes/pkg/util/testing"
"k8s.io/kubernetes/pkg/util/uuid"
. "k8s.io/kubernetes/pkg/volume" . "k8s.io/kubernetes/pkg/volume"
) )
...@@ -474,7 +474,7 @@ type FakeProvisioner struct { ...@@ -474,7 +474,7 @@ type FakeProvisioner struct {
} }
func (fc *FakeProvisioner) Provision() (*api.PersistentVolume, error) { func (fc *FakeProvisioner) Provision() (*api.PersistentVolume, error) {
fullpath := fmt.Sprintf("/tmp/hostpath_pv/%s", util.NewUUID()) fullpath := fmt.Sprintf("/tmp/hostpath_pv/%s", uuid.NewUUID())
pv := &api.PersistentVolume{ pv := &api.PersistentVolume{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
......
...@@ -21,8 +21,8 @@ import ( ...@@ -21,8 +21,8 @@ import (
"time" "time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -124,7 +124,7 @@ func getRestartCount(p *api.Pod) int { ...@@ -124,7 +124,7 @@ func getRestartCount(p *api.Pod) int {
func makePodSpec(readinessProbe, livenessProbe *api.Probe) *api.Pod { func makePodSpec(readinessProbe, livenessProbe *api.Probe) *api.Pod {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{Name: "test-webserver-" + string(util.NewUUID())}, ObjectMeta: api.ObjectMeta{Name: "test-webserver-" + string(uuid.NewUUID())},
Spec: api.PodSpec{ Spec: api.PodSpec{
Containers: []api.Container{ Containers: []api.Container{
{ {
......
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"time" "time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -63,7 +63,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() { ...@@ -63,7 +63,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
// minute) plus additional time for fudge factor. // minute) plus additional time for fudge factor.
const podLogTimeout = 300 * time.Second const podLogTimeout = 300 * time.Second
name := "configmap-test-upd-" + string(util.NewUUID()) name := "configmap-test-upd-" + string(uuid.NewUUID())
volumeName := "configmap-volume" volumeName := "configmap-volume"
volumeMountPath := "/etc/configmap-volume" volumeMountPath := "/etc/configmap-volume"
containerName := "configmap-volume-test" containerName := "configmap-volume-test"
...@@ -92,7 +92,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() { ...@@ -92,7 +92,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()), Name: "pod-configmaps-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Volumes: []api.Volume{ Volumes: []api.Volume{
...@@ -152,7 +152,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() { ...@@ -152,7 +152,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
}) })
It("should be consumable via environment variable [Conformance]", func() { It("should be consumable via environment variable [Conformance]", func() {
name := "configmap-test-" + string(util.NewUUID()) name := "configmap-test-" + string(uuid.NewUUID())
configMap := newConfigMap(f, name) configMap := newConfigMap(f, name)
By(fmt.Sprintf("Creating configMap %v/%v", f.Namespace.Name, configMap.Name)) By(fmt.Sprintf("Creating configMap %v/%v", f.Namespace.Name, configMap.Name))
defer func() { defer func() {
...@@ -168,7 +168,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() { ...@@ -168,7 +168,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()), Name: "pod-configmaps-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Containers: []api.Container{ Containers: []api.Container{
...@@ -202,7 +202,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() { ...@@ -202,7 +202,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
It("should be consumable in multiple volumes in the same pod", func() { It("should be consumable in multiple volumes in the same pod", func() {
var ( var (
name = "configmap-test-volume-" + string(util.NewUUID()) name = "configmap-test-volume-" + string(uuid.NewUUID())
volumeName = "configmap-volume" volumeName = "configmap-volume"
volumeMountPath = "/etc/configmap-volume" volumeMountPath = "/etc/configmap-volume"
volumeName2 = "configmap-volume-2" volumeName2 = "configmap-volume-2"
...@@ -224,7 +224,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() { ...@@ -224,7 +224,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()), Name: "pod-configmaps-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Volumes: []api.Volume{ Volumes: []api.Volume{
...@@ -295,7 +295,7 @@ func newConfigMap(f *framework.Framework, name string) *api.ConfigMap { ...@@ -295,7 +295,7 @@ func newConfigMap(f *framework.Framework, name string) *api.ConfigMap {
func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) { func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
var ( var (
name = "configmap-test-volume-" + string(util.NewUUID()) name = "configmap-test-volume-" + string(uuid.NewUUID())
volumeName = "configmap-volume" volumeName = "configmap-volume"
volumeMountPath = "/etc/configmap-volume" volumeMountPath = "/etc/configmap-volume"
configMap = newConfigMap(f, name) configMap = newConfigMap(f, name)
...@@ -315,7 +315,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) { ...@@ -315,7 +315,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()), Name: "pod-configmaps-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
SecurityContext: &api.PodSecurityContext{}, SecurityContext: &api.PodSecurityContext{},
...@@ -365,7 +365,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) { ...@@ -365,7 +365,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) { func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) {
var ( var (
name = "configmap-test-volume-map-" + string(util.NewUUID()) name = "configmap-test-volume-map-" + string(uuid.NewUUID())
volumeName = "configmap-volume" volumeName = "configmap-volume"
volumeMountPath = "/etc/configmap-volume" volumeMountPath = "/etc/configmap-volume"
configMap = newConfigMap(f, name) configMap = newConfigMap(f, name)
...@@ -385,7 +385,7 @@ func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) { ...@@ -385,7 +385,7 @@ func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()), Name: "pod-configmaps-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
SecurityContext: &api.PodSecurityContext{}, SecurityContext: &api.PodSecurityContext{},
......
...@@ -28,8 +28,8 @@ import ( ...@@ -28,8 +28,8 @@ import (
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/master/ports" "k8s.io/kubernetes/pkg/master/ports"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
...@@ -187,7 +187,7 @@ func getContainerRestarts(c *client.Client, ns string, labelSelector labels.Sele ...@@ -187,7 +187,7 @@ func getContainerRestarts(c *client.Client, ns string, labelSelector labels.Sele
var _ = framework.KubeDescribe("DaemonRestart [Disruptive]", func() { var _ = framework.KubeDescribe("DaemonRestart [Disruptive]", func() {
f := framework.NewDefaultFramework("daemonrestart") f := framework.NewDefaultFramework("daemonrestart")
rcName := "daemonrestart" + strconv.Itoa(numPods) + "-" + string(util.NewUUID()) rcName := "daemonrestart" + strconv.Itoa(numPods) + "-" + string(uuid.NewUUID())
labelSelector := labels.Set(map[string]string{"name": rcName}).AsSelector() labelSelector := labels.Set(map[string]string{"name": rcName}).AsSelector()
existingPods := cache.NewStore(cache.MetaNamespaceKeyFunc) existingPods := cache.NewStore(cache.MetaNamespaceKeyFunc)
var ns string var ns string
......
...@@ -34,7 +34,7 @@ import ( ...@@ -34,7 +34,7 @@ import (
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util" utiluuid "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
...@@ -242,7 +242,7 @@ var _ = framework.KubeDescribe("Density", func() { ...@@ -242,7 +242,7 @@ var _ = framework.KubeDescribe("Density", func() {
err := framework.CheckTestingNSDeletedExcept(c, ns) err := framework.CheckTestingNSDeletedExcept(c, ns)
framework.ExpectNoError(err) framework.ExpectNoError(err)
uuid = string(util.NewUUID()) uuid = string(utiluuid.NewUUID())
framework.ExpectNoError(framework.ResetMetrics(c)) framework.ExpectNoError(framework.ResetMetrics(c))
framework.ExpectNoError(os.Mkdir(fmt.Sprintf(framework.TestContext.OutputDir+"/%s", uuid), 0777)) framework.ExpectNoError(os.Mkdir(fmt.Sprintf(framework.TestContext.OutputDir+"/%s", uuid), 0777))
......
...@@ -29,7 +29,7 @@ import ( ...@@ -29,7 +29,7 @@ import (
"k8s.io/kubernetes/pkg/apimachinery/registered" "k8s.io/kubernetes/pkg/apimachinery/registered"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
) )
...@@ -49,7 +49,7 @@ func createDNSPod(namespace, wheezyProbeCmd, jessieProbeCmd string, useAnnotatio ...@@ -49,7 +49,7 @@ func createDNSPod(namespace, wheezyProbeCmd, jessieProbeCmd string, useAnnotatio
APIVersion: registered.GroupOrDie(api.GroupName).GroupVersion.String(), APIVersion: registered.GroupOrDie(api.GroupName).GroupVersion.String(),
}, },
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "dns-test-" + string(util.NewUUID()), Name: "dns-test-" + string(uuid.NewUUID()),
Namespace: namespace, Namespace: namespace,
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
......
...@@ -19,7 +19,7 @@ package e2e ...@@ -19,7 +19,7 @@ package e2e
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -76,7 +76,7 @@ const testContainerName = "test-container" ...@@ -76,7 +76,7 @@ const testContainerName = "test-container"
// Return a prototypical entrypoint test pod // Return a prototypical entrypoint test pod
func entrypointTestPod() *api.Pod { func entrypointTestPod() *api.Pod {
podName := "client-containers-" + string(util.NewUUID()) podName := "client-containers-" + string(uuid.NewUUID())
return &api.Pod{ return &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
......
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -31,7 +31,7 @@ var _ = framework.KubeDescribe("Downward API", func() { ...@@ -31,7 +31,7 @@ var _ = framework.KubeDescribe("Downward API", func() {
f := framework.NewDefaultFramework("downward-api") f := framework.NewDefaultFramework("downward-api")
It("should provide pod name and namespace as env vars [Conformance]", func() { It("should provide pod name and namespace as env vars [Conformance]", func() {
podName := "downward-api-" + string(util.NewUUID()) podName := "downward-api-" + string(uuid.NewUUID())
env := []api.EnvVar{ env := []api.EnvVar{
{ {
Name: "POD_NAME", Name: "POD_NAME",
...@@ -62,7 +62,7 @@ var _ = framework.KubeDescribe("Downward API", func() { ...@@ -62,7 +62,7 @@ var _ = framework.KubeDescribe("Downward API", func() {
}) })
It("should provide pod IP as an env var", func() { It("should provide pod IP as an env var", func() {
podName := "downward-api-" + string(util.NewUUID()) podName := "downward-api-" + string(uuid.NewUUID())
env := []api.EnvVar{ env := []api.EnvVar{
{ {
Name: "POD_IP", Name: "POD_IP",
...@@ -83,7 +83,7 @@ var _ = framework.KubeDescribe("Downward API", func() { ...@@ -83,7 +83,7 @@ var _ = framework.KubeDescribe("Downward API", func() {
}) })
It("should provide container's limits.cpu/memory and requests.cpu/memory as env vars", func() { It("should provide container's limits.cpu/memory and requests.cpu/memory as env vars", func() {
podName := "downward-api-" + string(util.NewUUID()) podName := "downward-api-" + string(uuid.NewUUID())
env := []api.EnvVar{ env := []api.EnvVar{
{ {
Name: "CPU_LIMIT", Name: "CPU_LIMIT",
...@@ -129,7 +129,7 @@ var _ = framework.KubeDescribe("Downward API", func() { ...@@ -129,7 +129,7 @@ var _ = framework.KubeDescribe("Downward API", func() {
}) })
It("should provide default limits.cpu/memory from node capacity", func() { It("should provide default limits.cpu/memory from node capacity", func() {
podName := "downward-api-" + string(util.NewUUID()) podName := "downward-api-" + string(uuid.NewUUID())
env := []api.EnvVar{ env := []api.EnvVar{
{ {
Name: "CPU_LIMIT", Name: "CPU_LIMIT",
......
...@@ -22,7 +22,7 @@ import ( ...@@ -22,7 +22,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -35,7 +35,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() { ...@@ -35,7 +35,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
f := framework.NewDefaultFramework("downward-api") f := framework.NewDefaultFramework("downward-api")
It("should provide podname only [Conformance]", func() { It("should provide podname only [Conformance]", func() {
podName := "downwardapi-volume-" + string(util.NewUUID()) podName := "downwardapi-volume-" + string(uuid.NewUUID())
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podname") pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podname")
framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{ framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{
...@@ -44,7 +44,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() { ...@@ -44,7 +44,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
}) })
It("should provide podname as non-root with fsgroup [Feature:FSGroup]", func() { It("should provide podname as non-root with fsgroup [Feature:FSGroup]", func() {
podName := "metadata-volume-" + string(util.NewUUID()) podName := "metadata-volume-" + string(uuid.NewUUID())
uid := int64(1001) uid := int64(1001)
gid := int64(1234) gid := int64(1234)
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podname") pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podname")
...@@ -62,7 +62,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() { ...@@ -62,7 +62,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
labels["key1"] = "value1" labels["key1"] = "value1"
labels["key2"] = "value2" labels["key2"] = "value2"
podName := "labelsupdate" + string(util.NewUUID()) podName := "labelsupdate" + string(uuid.NewUUID())
pod := downwardAPIVolumePodForUpdateTest(podName, labels, map[string]string{}, "/etc/labels") pod := downwardAPIVolumePodForUpdateTest(podName, labels, map[string]string{}, "/etc/labels")
containerName := "client-container" containerName := "client-container"
defer func() { defer func() {
...@@ -94,7 +94,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() { ...@@ -94,7 +94,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
It("should update annotations on modification [Conformance]", func() { It("should update annotations on modification [Conformance]", func() {
annotations := map[string]string{} annotations := map[string]string{}
annotations["builder"] = "bar" annotations["builder"] = "bar"
podName := "annotationupdate" + string(util.NewUUID()) podName := "annotationupdate" + string(uuid.NewUUID())
pod := downwardAPIVolumePodForUpdateTest(podName, map[string]string{}, annotations, "/etc/annotations") pod := downwardAPIVolumePodForUpdateTest(podName, map[string]string{}, annotations, "/etc/annotations")
containerName := "client-container" containerName := "client-container"
...@@ -127,7 +127,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() { ...@@ -127,7 +127,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
}) })
It("should provide container's cpu limit", func() { It("should provide container's cpu limit", func() {
podName := "downwardapi-volume-" + string(util.NewUUID()) podName := "downwardapi-volume-" + string(uuid.NewUUID())
pod := downwardAPIVolumeForContainerResources(podName, "/etc/cpu_limit") pod := downwardAPIVolumeForContainerResources(podName, "/etc/cpu_limit")
framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{ framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{
...@@ -136,7 +136,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() { ...@@ -136,7 +136,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
}) })
It("should provide container's memory limit", func() { It("should provide container's memory limit", func() {
podName := "downwardapi-volume-" + string(util.NewUUID()) podName := "downwardapi-volume-" + string(uuid.NewUUID())
pod := downwardAPIVolumeForContainerResources(podName, "/etc/memory_limit") pod := downwardAPIVolumeForContainerResources(podName, "/etc/memory_limit")
framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{ framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{
...@@ -145,7 +145,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() { ...@@ -145,7 +145,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
}) })
It("should provide container's cpu request", func() { It("should provide container's cpu request", func() {
podName := "downwardapi-volume-" + string(util.NewUUID()) podName := "downwardapi-volume-" + string(uuid.NewUUID())
pod := downwardAPIVolumeForContainerResources(podName, "/etc/cpu_request") pod := downwardAPIVolumeForContainerResources(podName, "/etc/cpu_request")
framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{ framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{
...@@ -154,7 +154,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() { ...@@ -154,7 +154,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
}) })
It("should provide container's memory request", func() { It("should provide container's memory request", func() {
podName := "downwardapi-volume-" + string(util.NewUUID()) podName := "downwardapi-volume-" + string(uuid.NewUUID())
pod := downwardAPIVolumeForContainerResources(podName, "/etc/memory_request") pod := downwardAPIVolumeForContainerResources(podName, "/etc/memory_request")
framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{ framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apimachinery/registered" "k8s.io/kubernetes/pkg/apimachinery/registered"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -311,7 +311,7 @@ func formatMedium(medium api.StorageMedium) string { ...@@ -311,7 +311,7 @@ func formatMedium(medium api.StorageMedium) string {
} }
func testPodWithVolume(image, path string, source *api.EmptyDirVolumeSource) *api.Pod { func testPodWithVolume(image, path string, source *api.EmptyDirVolumeSource) *api.Pod {
podName := "pod-" + string(util.NewUUID()) podName := "pod-" + string(uuid.NewUUID())
return &api.Pod{ return &api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
Kind: "Pod", Kind: "Pod",
......
...@@ -18,8 +18,8 @@ package e2e ...@@ -18,8 +18,8 @@ package e2e
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
"strconv" "strconv"
...@@ -33,7 +33,7 @@ var _ = framework.KubeDescribe("EmptyDir wrapper volumes", func() { ...@@ -33,7 +33,7 @@ var _ = framework.KubeDescribe("EmptyDir wrapper volumes", func() {
f := framework.NewDefaultFramework("emptydir-wrapper") f := framework.NewDefaultFramework("emptydir-wrapper")
It("should becomes running", func() { It("should becomes running", func() {
name := "emptydir-wrapper-test-" + string(util.NewUUID()) name := "emptydir-wrapper-test-" + string(uuid.NewUUID())
volumeName := "secret-volume" volumeName := "secret-volume"
volumeMountPath := "/etc/secret-volume" volumeMountPath := "/etc/secret-volume"
...@@ -52,7 +52,7 @@ var _ = framework.KubeDescribe("EmptyDir wrapper volumes", func() { ...@@ -52,7 +52,7 @@ var _ = framework.KubeDescribe("EmptyDir wrapper volumes", func() {
framework.Failf("unable to create test secret %s: %v", secret.Name, err) framework.Failf("unable to create test secret %s: %v", secret.Name, err)
} }
gitServerPodName := "git-server-" + string(util.NewUUID()) gitServerPodName := "git-server-" + string(uuid.NewUUID())
containerPort := 8000 containerPort := 8000
labels := map[string]string{"name": gitServerPodName} labels := map[string]string{"name": gitServerPodName}
...@@ -110,7 +110,7 @@ var _ = framework.KubeDescribe("EmptyDir wrapper volumes", func() { ...@@ -110,7 +110,7 @@ var _ = framework.KubeDescribe("EmptyDir wrapper volumes", func() {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-secrets-" + string(util.NewUUID()), Name: "pod-secrets-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Volumes: []api.Volume{ Volumes: []api.Volume{
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
...@@ -40,7 +40,7 @@ var _ = framework.KubeDescribe("Events", func() { ...@@ -40,7 +40,7 @@ var _ = framework.KubeDescribe("Events", func() {
podClient := f.Client.Pods(f.Namespace.Name) podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod") By("creating the pod")
name := "send-events-" + string(util.NewUUID()) name := "send-events-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond()) value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
......
...@@ -18,7 +18,7 @@ package e2e ...@@ -18,7 +18,7 @@ package e2e
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -30,7 +30,7 @@ var _ = framework.KubeDescribe("Variable Expansion", func() { ...@@ -30,7 +30,7 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
f := framework.NewDefaultFramework("var-expansion") f := framework.NewDefaultFramework("var-expansion")
It("should allow composing env vars into new env vars [Conformance]", func() { It("should allow composing env vars into new env vars [Conformance]", func() {
podName := "var-expansion-" + string(util.NewUUID()) podName := "var-expansion-" + string(uuid.NewUUID())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: podName, Name: podName,
...@@ -70,7 +70,7 @@ var _ = framework.KubeDescribe("Variable Expansion", func() { ...@@ -70,7 +70,7 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
}) })
It("should allow substituting values in a container's command [Conformance]", func() { It("should allow substituting values in a container's command [Conformance]", func() {
podName := "var-expansion-" + string(util.NewUUID()) podName := "var-expansion-" + string(uuid.NewUUID())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: podName, Name: podName,
...@@ -100,7 +100,7 @@ var _ = framework.KubeDescribe("Variable Expansion", func() { ...@@ -100,7 +100,7 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
}) })
It("should allow substituting values in a container's args [Conformance]", func() { It("should allow substituting values in a container's args [Conformance]", func() {
podName := "var-expansion-" + string(util.NewUUID()) podName := "var-expansion-" + string(uuid.NewUUID())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: podName, Name: podName,
......
...@@ -63,9 +63,9 @@ import ( ...@@ -63,9 +63,9 @@ import (
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
sshutil "k8s.io/kubernetes/pkg/ssh" sshutil "k8s.io/kubernetes/pkg/ssh"
"k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
labelsutil "k8s.io/kubernetes/pkg/util/labels" labelsutil "k8s.io/kubernetes/pkg/util/labels"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
utilyaml "k8s.io/kubernetes/pkg/util/yaml" utilyaml "k8s.io/kubernetes/pkg/util/yaml"
"k8s.io/kubernetes/pkg/version" "k8s.io/kubernetes/pkg/version"
...@@ -211,7 +211,7 @@ func GetServicesProxyRequest(c *client.Client, request *restclient.Request) (*re ...@@ -211,7 +211,7 @@ func GetServicesProxyRequest(c *client.Client, request *restclient.Request) (*re
} }
// unique identifier of the e2e run // unique identifier of the e2e run
var RunId = util.NewUUID() var RunId = uuid.NewUUID()
type CreateTestingNSFn func(baseName string, c *client.Client, labels map[string]string) (*api.Namespace, error) type CreateTestingNSFn func(baseName string, c *client.Client, labels map[string]string) (*api.Namespace, error)
...@@ -2601,7 +2601,7 @@ func StartPods(c *client.Client, replicas int, namespace string, podNamePrefix s ...@@ -2601,7 +2601,7 @@ func StartPods(c *client.Client, replicas int, namespace string, podNamePrefix s
if replicas < 1 { if replicas < 1 {
panic("StartPods: number of replicas must be non-zero") panic("StartPods: number of replicas must be non-zero")
} }
startPodsID := string(util.NewUUID()) // So that we can label and find them startPodsID := string(uuid.NewUUID()) // So that we can label and find them
for i := 0; i < replicas; i++ { for i := 0; i < replicas; i++ {
podName := fmt.Sprintf("%v-%v", podNamePrefix, i) podName := fmt.Sprintf("%v-%v", podNamePrefix, i)
pod.ObjectMeta.Name = podName pod.ObjectMeta.Name = podName
......
...@@ -25,8 +25,8 @@ import ( ...@@ -25,8 +25,8 @@ import (
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
...@@ -101,7 +101,7 @@ var _ = framework.KubeDescribe("Generated release_1_2 clientset", func() { ...@@ -101,7 +101,7 @@ var _ = framework.KubeDescribe("Generated release_1_2 clientset", func() {
It("should create pods, delete pods, watch pods", func() { It("should create pods, delete pods, watch pods", func() {
podClient := f.Clientset_1_2.Core().Pods(f.Namespace.Name) podClient := f.Clientset_1_2.Core().Pods(f.Namespace.Name)
By("constructing the pod") By("constructing the pod")
name := "pod" + string(util.NewUUID()) name := "pod" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond()) value := strconv.Itoa(time.Now().Nanosecond())
podCopy := testingPod(name, value) podCopy := testingPod(name, value)
pod := &podCopy pod := &podCopy
...@@ -175,7 +175,7 @@ var _ = framework.KubeDescribe("Generated release_1_3 clientset", func() { ...@@ -175,7 +175,7 @@ var _ = framework.KubeDescribe("Generated release_1_3 clientset", func() {
It("should create pods, delete pods, watch pods", func() { It("should create pods, delete pods, watch pods", func() {
podClient := f.Clientset_1_3.Core().Pods(f.Namespace.Name) podClient := f.Clientset_1_3.Core().Pods(f.Namespace.Name)
By("constructing the pod") By("constructing the pod")
name := "pod" + string(util.NewUUID()) name := "pod" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond()) value := strconv.Itoa(time.Now().Nanosecond())
podCopy := testingPod(name, value) podCopy := testingPod(name, value)
pod := &podCopy pod := &podCopy
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apimachinery/registered" "k8s.io/kubernetes/pkg/apimachinery/registered"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -69,7 +69,7 @@ func testPodWithSsd(command string) *api.Pod { ...@@ -69,7 +69,7 @@ func testPodWithSsd(command string) *api.Pod {
containerName := "test-container" containerName := "test-container"
volumeName := "test-ssd-volume" volumeName := "test-ssd-volume"
path := "/mnt/disks/ssd0" path := "/mnt/disks/ssd0"
podName := "pod-" + string(util.NewUUID()) podName := "pod-" + string(uuid.NewUUID())
image := "ubuntu:14.04" image := "ubuntu:14.04"
return &api.Pod{ return &api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
......
...@@ -51,8 +51,8 @@ import ( ...@@ -51,8 +51,8 @@ import (
"k8s.io/kubernetes/pkg/kubectl/cmd/util" "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/registry/generic/registry" "k8s.io/kubernetes/pkg/registry/generic/registry"
pkgutil "k8s.io/kubernetes/pkg/util"
utilnet "k8s.io/kubernetes/pkg/util/net" utilnet "k8s.io/kubernetes/pkg/util/net"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/version" "k8s.io/kubernetes/pkg/version"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
...@@ -1169,7 +1169,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() { ...@@ -1169,7 +1169,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
framework.KubeDescribe("Kubectl taint", func() { framework.KubeDescribe("Kubectl taint", func() {
It("should update the taint on a node", func() { It("should update the taint on a node", func() {
taintName := fmt.Sprintf("kubernetes.io/e2e-taint-key-%s", string(pkgutil.NewUUID())) taintName := fmt.Sprintf("kubernetes.io/e2e-taint-key-%s", string(uuid.NewUUID()))
taintValue := "testing-taint-value" taintValue := "testing-taint-value"
taintEffect := fmt.Sprintf("%s", api.TaintEffectNoSchedule) taintEffect := fmt.Sprintf("%s", api.TaintEffectNoSchedule)
......
...@@ -23,8 +23,8 @@ import ( ...@@ -23,8 +23,8 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
...@@ -183,7 +183,7 @@ var _ = framework.KubeDescribe("kubelet", func() { ...@@ -183,7 +183,7 @@ var _ = framework.KubeDescribe("kubelet", func() {
It(name, func() { It(name, func() {
totalPods := itArg.podsPerNode * numNodes totalPods := itArg.podsPerNode * numNodes
By(fmt.Sprintf("Creating a RC of %d pods and wait until all pods of this RC are running", totalPods)) By(fmt.Sprintf("Creating a RC of %d pods and wait until all pods of this RC are running", totalPods))
rcName := fmt.Sprintf("cleanup%d-%s", totalPods, string(util.NewUUID())) rcName := fmt.Sprintf("cleanup%d-%s", totalPods, string(uuid.NewUUID()))
Expect(framework.RunRC(framework.RCConfig{ Expect(framework.RunRC(framework.RCConfig{
Client: f.Client, Client: f.Client,
......
...@@ -24,8 +24,8 @@ import ( ...@@ -24,8 +24,8 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats" "k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -65,7 +65,7 @@ func runResourceTrackingTest(f *framework.Framework, podsPerNode int, nodeNames ...@@ -65,7 +65,7 @@ func runResourceTrackingTest(f *framework.Framework, podsPerNode int, nodeNames
numNodes := nodeNames.Len() numNodes := nodeNames.Len()
totalPods := podsPerNode * numNodes totalPods := podsPerNode * numNodes
By(fmt.Sprintf("Creating a RC of %d pods and wait until all pods of this RC are running", totalPods)) By(fmt.Sprintf("Creating a RC of %d pods and wait until all pods of this RC are running", totalPods))
rcName := fmt.Sprintf("resource%d-%s", totalPods, string(util.NewUUID())) rcName := fmt.Sprintf("resource%d-%s", totalPods, string(uuid.NewUUID()))
// TODO: Use a more realistic workload // TODO: Use a more realistic workload
Expect(framework.RunRC(framework.RCConfig{ Expect(framework.RunRC(framework.RCConfig{
......
...@@ -32,9 +32,9 @@ import ( ...@@ -32,9 +32,9 @@ import (
"k8s.io/kubernetes/pkg/apimachinery/registered" "k8s.io/kubernetes/pkg/apimachinery/registered"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/intstr"
utilnet "k8s.io/kubernetes/pkg/util/net" utilnet "k8s.io/kubernetes/pkg/util/net"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
) )
...@@ -457,7 +457,7 @@ func (config *KubeProxyTestConfig) createService(serviceSpec *api.Service) *api. ...@@ -457,7 +457,7 @@ func (config *KubeProxyTestConfig) createService(serviceSpec *api.Service) *api.
func (config *KubeProxyTestConfig) setup() { func (config *KubeProxyTestConfig) setup() {
By("creating a selector") By("creating a selector")
selectorName := "selector-" + string(util.NewUUID()) selectorName := "selector-" + string(uuid.NewUUID())
serviceSelector := map[string]string{ serviceSelector := map[string]string{
selectorName: "true", selectorName: "true",
} }
......
...@@ -25,8 +25,8 @@ import ( ...@@ -25,8 +25,8 @@ import (
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/system" "k8s.io/kubernetes/pkg/util/system"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -47,7 +47,7 @@ var _ = framework.KubeDescribe("NodeProblemDetector", func() { ...@@ -47,7 +47,7 @@ var _ = framework.KubeDescribe("NodeProblemDetector", func() {
BeforeEach(func() { BeforeEach(func() {
c = f.Client c = f.Client
ns = f.Namespace.Name ns = f.Namespace.Name
uid = string(util.NewUUID()) uid = string(uuid.NewUUID())
name = "node-problem-detector-" + uid name = "node-problem-detector-" + uid
configName = "node-problem-detector-config-" + uid configName = "node-problem-detector-config-" + uid
// There is no namespace for Node, event recorder will set default namespace for node events. // There is no namespace for Node, event recorder will set default namespace for node events.
......
...@@ -37,7 +37,7 @@ import ( ...@@ -37,7 +37,7 @@ import (
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
awscloud "k8s.io/kubernetes/pkg/cloudprovider/providers/aws" awscloud "k8s.io/kubernetes/pkg/cloudprovider/providers/aws"
gcecloud "k8s.io/kubernetes/pkg/cloudprovider/providers/gce" gcecloud "k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
) )
...@@ -461,7 +461,7 @@ func verifyPDContentsViaContainer(f *framework.Framework, podName, containerName ...@@ -461,7 +461,7 @@ func verifyPDContentsViaContainer(f *framework.Framework, podName, containerName
func createPD() (string, error) { func createPD() (string, error) {
if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" { if framework.TestContext.Provider == "gce" || framework.TestContext.Provider == "gke" {
pdName := fmt.Sprintf("%s-%s", framework.TestContext.Prefix, string(util.NewUUID())) pdName := fmt.Sprintf("%s-%s", framework.TestContext.Prefix, string(uuid.NewUUID()))
gceCloud, err := getGCECloud() gceCloud, err := getGCECloud()
if err != nil { if err != nil {
...@@ -604,7 +604,7 @@ func testPDPod(diskNames []string, targetHost string, readOnly bool, numContaine ...@@ -604,7 +604,7 @@ func testPDPod(diskNames []string, targetHost string, readOnly bool, numContaine
APIVersion: registered.GroupOrDie(api.GroupName).GroupVersion.String(), APIVersion: registered.GroupOrDie(api.GroupName).GroupVersion.String(),
}, },
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pd-test-" + string(util.NewUUID()), Name: "pd-test-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Containers: containers, Containers: containers,
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
) )
...@@ -79,7 +79,7 @@ var _ = framework.KubeDescribe("Garbage collector [Feature:GarbageCollector] [Sl ...@@ -79,7 +79,7 @@ var _ = framework.KubeDescribe("Garbage collector [Feature:GarbageCollector] [Sl
}) })
func createTerminatingPod(f *framework.Framework) (*api.Pod, error) { func createTerminatingPod(f *framework.Framework) (*api.Pod, error) {
uuid := util.NewUUID() uuid := uuid.NewUUID()
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: string(uuid), Name: string(uuid),
......
...@@ -31,8 +31,8 @@ import ( ...@@ -31,8 +31,8 @@ import (
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/kubelet" "k8s.io/kubernetes/pkg/kubelet"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
...@@ -210,7 +210,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -210,7 +210,7 @@ var _ = framework.KubeDescribe("Pods", func() {
f := framework.NewDefaultFramework("pods") f := framework.NewDefaultFramework("pods")
It("should get a host IP [Conformance]", func() { It("should get a host IP [Conformance]", func() {
name := "pod-hostip-" + string(util.NewUUID()) name := "pod-hostip-" + string(uuid.NewUUID())
testHostIP(f.Client, f.Namespace.Name, &api.Pod{ testHostIP(f.Client, f.Namespace.Name, &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: name, Name: name,
...@@ -230,7 +230,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -230,7 +230,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name) podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod") By("creating the pod")
name := "pod-update-" + string(util.NewUUID()) name := "pod-update-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond()) value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
...@@ -267,7 +267,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -267,7 +267,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name) podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod") By("creating the pod")
name := "pod-update-" + string(util.NewUUID()) name := "pod-update-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond()) value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
...@@ -414,7 +414,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -414,7 +414,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name) podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod") By("creating the pod")
name := "pod-update-" + string(util.NewUUID()) name := "pod-update-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond()) value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
...@@ -482,7 +482,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -482,7 +482,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name) podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod") By("creating the pod")
name := "pod-update-activedeadlineseconds-" + string(util.NewUUID()) name := "pod-update-activedeadlineseconds-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond()) value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
...@@ -542,7 +542,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -542,7 +542,7 @@ var _ = framework.KubeDescribe("Pods", func() {
It("should contain environment variables for services [Conformance]", func() { It("should contain environment variables for services [Conformance]", func() {
// Make a pod that will be a service. // Make a pod that will be a service.
// This pod serves its hostname via HTTP. // This pod serves its hostname via HTTP.
serverName := "server-envvars-" + string(util.NewUUID()) serverName := "server-envvars-" + string(uuid.NewUUID())
serverPod := &api.Pod{ serverPod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: serverName, Name: serverName,
...@@ -597,7 +597,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -597,7 +597,7 @@ var _ = framework.KubeDescribe("Pods", func() {
} }
// Make a client pod that verifies that it has the service environment variables. // Make a client pod that verifies that it has the service environment variables.
podName := "client-envvars-" + string(util.NewUUID()) podName := "client-envvars-" + string(uuid.NewUUID())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: podName, Name: podName,
...@@ -631,7 +631,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -631,7 +631,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name) podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod") By("creating the pod")
name := "pod-init-" + string(util.NewUUID()) name := "pod-init-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond()) value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
...@@ -697,7 +697,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -697,7 +697,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name) podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod") By("creating the pod")
name := "pod-init-" + string(util.NewUUID()) name := "pod-init-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond()) value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
...@@ -767,7 +767,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -767,7 +767,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name) podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod") By("creating the pod")
name := "pod-init-" + string(util.NewUUID()) name := "pod-init-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond()) value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
...@@ -883,7 +883,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -883,7 +883,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name) podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod") By("creating the pod")
name := "pod-init-" + string(util.NewUUID()) name := "pod-init-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond()) value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
...@@ -1142,7 +1142,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -1142,7 +1142,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name) podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod") By("creating the pod")
name := "pod-exec-websocket-" + string(util.NewUUID()) name := "pod-exec-websocket-" + string(uuid.NewUUID())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: name, Name: name,
...@@ -1221,7 +1221,7 @@ var _ = framework.KubeDescribe("Pods", func() { ...@@ -1221,7 +1221,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name) podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod") By("creating the pod")
name := "pod-logs-websocket-" + string(util.NewUUID()) name := "pod-logs-websocket-" + string(uuid.NewUUID())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: name, Name: name,
......
...@@ -22,7 +22,7 @@ import ( ...@@ -22,7 +22,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
...@@ -49,7 +49,7 @@ var _ = framework.KubeDescribe("ReplicationController", func() { ...@@ -49,7 +49,7 @@ var _ = framework.KubeDescribe("ReplicationController", func() {
// a replication controller. The image serves its hostname // a replication controller. The image serves its hostname
// which is checked for each replica. // which is checked for each replica.
func ServeImageOrFail(f *framework.Framework, test string, image string) { func ServeImageOrFail(f *framework.Framework, test string, image string) {
name := "my-hostname-" + test + "-" + string(util.NewUUID()) name := "my-hostname-" + test + "-" + string(uuid.NewUUID())
replicas := int32(2) replicas := int32(2)
// Create a replication controller for a service // Create a replication controller for a service
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
...@@ -50,7 +50,7 @@ var _ = framework.KubeDescribe("ReplicaSet", func() { ...@@ -50,7 +50,7 @@ var _ = framework.KubeDescribe("ReplicaSet", func() {
// A basic test to check the deployment of an image using a ReplicaSet. The // A basic test to check the deployment of an image using a ReplicaSet. The
// image serves its hostname which is checked for each replica. // image serves its hostname which is checked for each replica.
func ReplicaSetServeImageOrFail(f *framework.Framework, test string, image string) { func ReplicaSetServeImageOrFail(f *framework.Framework, test string, image string) {
name := "my-hostname-" + test + "-" + string(util.NewUUID()) name := "my-hostname-" + test + "-" + string(uuid.NewUUID())
replicas := int32(2) replicas := int32(2)
// Create a ReplicaSet for a service that serves its hostname. // Create a ReplicaSet for a service that serves its hostname.
......
...@@ -25,9 +25,9 @@ import ( ...@@ -25,9 +25,9 @@ import (
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/system" "k8s.io/kubernetes/pkg/util/system"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -464,7 +464,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -464,7 +464,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
framework.ExpectNoError(err) framework.ExpectNoError(err)
By("Trying to apply a random label on the found node.") By("Trying to apply a random label on the found node.")
k := fmt.Sprintf("kubernetes.io/e2e-%s", string(util.NewUUID())) k := fmt.Sprintf("kubernetes.io/e2e-%s", string(uuid.NewUUID()))
v := "42" v := "42"
framework.AddOrUpdateLabelOnNode(c, nodeName, k, v) framework.AddOrUpdateLabelOnNode(c, nodeName, k, v)
framework.ExpectNodeHasLabel(c, nodeName, k, v) framework.ExpectNodeHasLabel(c, nodeName, k, v)
...@@ -597,7 +597,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -597,7 +597,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
framework.ExpectNoError(err) framework.ExpectNoError(err)
By("Trying to apply a random label on the found node.") By("Trying to apply a random label on the found node.")
k := fmt.Sprintf("kubernetes.io/e2e-%s", string(util.NewUUID())) k := fmt.Sprintf("kubernetes.io/e2e-%s", string(uuid.NewUUID()))
v := "42" v := "42"
framework.AddOrUpdateLabelOnNode(c, nodeName, k, v) framework.AddOrUpdateLabelOnNode(c, nodeName, k, v)
framework.ExpectNodeHasLabel(c, nodeName, k, v) framework.ExpectNodeHasLabel(c, nodeName, k, v)
...@@ -714,7 +714,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -714,7 +714,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// part of podAffinity,so validation fails. // part of podAffinity,so validation fails.
It("validates that a pod with an invalid podAffinity is rejected because of the LabelSelectorRequirement is invalid", func() { It("validates that a pod with an invalid podAffinity is rejected because of the LabelSelectorRequirement is invalid", func() {
By("Trying to launch a pod with an invalid pod Affinity data.") By("Trying to launch a pod with an invalid pod Affinity data.")
podName := "without-label-" + string(util.NewUUID()) podName := "without-label-" + string(uuid.NewUUID())
_, err := c.Pods(ns).Create(&api.Pod{ _, err := c.Pods(ns).Create(&api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
Kind: "Pod", Kind: "Pod",
...@@ -765,7 +765,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -765,7 +765,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// Test Nodes does not have any pod, hence it should be impossible to schedule a Pod with pod affinity. // Test Nodes does not have any pod, hence it should be impossible to schedule a Pod with pod affinity.
It("validates that Inter-pod-Affinity is respected if not matching [Feature:PodAffinity]", func() { It("validates that Inter-pod-Affinity is respected if not matching [Feature:PodAffinity]", func() {
By("Trying to schedule Pod with nonempty Pod Affinity.") By("Trying to schedule Pod with nonempty Pod Affinity.")
podName := "without-label-" + string(util.NewUUID()) podName := "without-label-" + string(uuid.NewUUID())
waitForStableCluster(c) waitForStableCluster(c)
...@@ -816,7 +816,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -816,7 +816,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// cluster and the scheduler it might be that a "normal" pod cannot be // cluster and the scheduler it might be that a "normal" pod cannot be
// scheduled onto it. // scheduled onto it.
By("Trying to launch a pod with a label to get a node which can launch it.") By("Trying to launch a pod with a label to get a node which can launch it.")
podName := "with-label-" + string(util.NewUUID()) podName := "with-label-" + string(uuid.NewUUID())
pod, err := c.Pods(ns).Create(&api.Pod{ pod, err := c.Pods(ns).Create(&api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
Kind: "Pod", Kind: "Pod",
...@@ -849,7 +849,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -849,7 +849,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveLabelOffNode(c, nodeName, k) defer framework.RemoveLabelOffNode(c, nodeName, k)
By("Trying to launch the pod, now with podAffinity.") By("Trying to launch the pod, now with podAffinity.")
labelPodName := "with-podaffinity-" + string(util.NewUUID()) labelPodName := "with-podaffinity-" + string(uuid.NewUUID())
pod, err = c.Pods(ns).Create(&api.Pod{ pod, err = c.Pods(ns).Create(&api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
Kind: "Pod", Kind: "Pod",
...@@ -902,7 +902,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -902,7 +902,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// cluster and the scheduler it might be that a "normal" pod cannot be // cluster and the scheduler it might be that a "normal" pod cannot be
// scheduled onto it. // scheduled onto it.
By("Trying to launch a pod with a label to get a node which can launch it.") By("Trying to launch a pod with a label to get a node which can launch it.")
podName := "with-label-" + string(util.NewUUID()) podName := "with-label-" + string(uuid.NewUUID())
pod, err := c.Pods(ns).Create(&api.Pod{ pod, err := c.Pods(ns).Create(&api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
Kind: "Pod", Kind: "Pod",
...@@ -935,7 +935,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -935,7 +935,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveLabelOffNode(c, nodeName, k) defer framework.RemoveLabelOffNode(c, nodeName, k)
By("Trying to launch the pod, now with podAffinity with same Labels.") By("Trying to launch the pod, now with podAffinity with same Labels.")
labelPodName := "with-podaffinity-" + string(util.NewUUID()) labelPodName := "with-podaffinity-" + string(uuid.NewUUID())
_, err = c.Pods(ns).Create(&api.Pod{ _, err = c.Pods(ns).Create(&api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
Kind: "Pod", Kind: "Pod",
...@@ -986,7 +986,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -986,7 +986,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// cluster and the scheduler it might be that a "normal" pod cannot be // cluster and the scheduler it might be that a "normal" pod cannot be
// scheduled onto it. // scheduled onto it.
By("Trying to launch a pod with a label to get a node which can launch it.") By("Trying to launch a pod with a label to get a node which can launch it.")
podName := "with-label-" + string(util.NewUUID()) podName := "with-label-" + string(uuid.NewUUID())
pod, err := c.Pods(ns).Create(&api.Pod{ pod, err := c.Pods(ns).Create(&api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
Kind: "Pod", Kind: "Pod",
...@@ -1019,7 +1019,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -1019,7 +1019,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveLabelOffNode(c, nodeName, k) defer framework.RemoveLabelOffNode(c, nodeName, k)
By("Trying to launch the pod, now with multiple pod affinities with diff LabelOperators.") By("Trying to launch the pod, now with multiple pod affinities with diff LabelOperators.")
labelPodName := "with-podaffinity-" + string(util.NewUUID()) labelPodName := "with-podaffinity-" + string(uuid.NewUUID())
pod, err = c.Pods(ns).Create(&api.Pod{ pod, err = c.Pods(ns).Create(&api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
Kind: "Pod", Kind: "Pod",
...@@ -1080,7 +1080,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -1080,7 +1080,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// cluster and the scheduler it might be that a "normal" pod cannot be // cluster and the scheduler it might be that a "normal" pod cannot be
// scheduled onto it. // scheduled onto it.
By("Trying to launch a pod with a label to get a node which can launch it.") By("Trying to launch a pod with a label to get a node which can launch it.")
podName := "with-label-" + string(util.NewUUID()) podName := "with-label-" + string(uuid.NewUUID())
pod, err := c.Pods(ns).Create(&api.Pod{ pod, err := c.Pods(ns).Create(&api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
Kind: "Pod", Kind: "Pod",
...@@ -1113,7 +1113,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -1113,7 +1113,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveLabelOffNode(c, nodeName, k) defer framework.RemoveLabelOffNode(c, nodeName, k)
By("Trying to launch the pod, now with Pod affinity and anti affinity.") By("Trying to launch the pod, now with Pod affinity and anti affinity.")
labelPodName := "with-podantiaffinity-" + string(util.NewUUID()) labelPodName := "with-podantiaffinity-" + string(uuid.NewUUID())
pod, err = c.Pods(ns).Create(&api.Pod{ pod, err = c.Pods(ns).Create(&api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
Kind: "Pod", Kind: "Pod",
...@@ -1177,7 +1177,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -1177,7 +1177,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// cluster and the scheduler it might be that a "normal" pod cannot be // cluster and the scheduler it might be that a "normal" pod cannot be
// scheduled onto it. // scheduled onto it.
By("Trying to launch a pod with label to get a node which can launch it.") By("Trying to launch a pod with label to get a node which can launch it.")
podName := "with-label-" + string(util.NewUUID()) podName := "with-label-" + string(uuid.NewUUID())
pod, err := c.Pods(ns).Create(&api.Pod{ pod, err := c.Pods(ns).Create(&api.Pod{
TypeMeta: unversioned.TypeMeta{ TypeMeta: unversioned.TypeMeta{
Kind: "Pod", Kind: "Pod",
...@@ -1264,7 +1264,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -1264,7 +1264,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
framework.ExpectNoError(err) framework.ExpectNoError(err)
By("Trying to apply a random taint on the found node.") By("Trying to apply a random taint on the found node.")
taintName := fmt.Sprintf("kubernetes.io/e2e-taint-key-%s", string(util.NewUUID())) taintName := fmt.Sprintf("kubernetes.io/e2e-taint-key-%s", string(uuid.NewUUID()))
taintValue := "testing-taint-value" taintValue := "testing-taint-value"
taintEffect := api.TaintEffectNoSchedule taintEffect := api.TaintEffectNoSchedule
framework.AddOrUpdateTaintOnNode(c, nodeName, api.Taint{Key: taintName, Value: taintValue, Effect: taintEffect}) framework.AddOrUpdateTaintOnNode(c, nodeName, api.Taint{Key: taintName, Value: taintValue, Effect: taintEffect})
...@@ -1272,7 +1272,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -1272,7 +1272,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveTaintOffNode(c, nodeName, taintName) defer framework.RemoveTaintOffNode(c, nodeName, taintName)
By("Trying to apply a random label on the found node.") By("Trying to apply a random label on the found node.")
labelKey := fmt.Sprintf("kubernetes.io/e2e-label-key-%s", string(util.NewUUID())) labelKey := fmt.Sprintf("kubernetes.io/e2e-label-key-%s", string(uuid.NewUUID()))
labelValue := "testing-label-value" labelValue := "testing-label-value"
framework.AddOrUpdateLabelOnNode(c, nodeName, labelKey, labelValue) framework.AddOrUpdateLabelOnNode(c, nodeName, labelKey, labelValue)
framework.ExpectNodeHasLabel(c, nodeName, labelKey, labelValue) framework.ExpectNodeHasLabel(c, nodeName, labelKey, labelValue)
...@@ -1359,7 +1359,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -1359,7 +1359,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
framework.ExpectNoError(err) framework.ExpectNoError(err)
By("Trying to apply a random taint on the found node.") By("Trying to apply a random taint on the found node.")
taintName := fmt.Sprintf("kubernetes.io/e2e-taint-key-%s", string(util.NewUUID())) taintName := fmt.Sprintf("kubernetes.io/e2e-taint-key-%s", string(uuid.NewUUID()))
taintValue := "testing-taint-value" taintValue := "testing-taint-value"
taintEffect := api.TaintEffectNoSchedule taintEffect := api.TaintEffectNoSchedule
framework.AddOrUpdateTaintOnNode(c, nodeName, api.Taint{Key: taintName, Value: taintValue, Effect: taintEffect}) framework.AddOrUpdateTaintOnNode(c, nodeName, api.Taint{Key: taintName, Value: taintValue, Effect: taintEffect})
...@@ -1367,7 +1367,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { ...@@ -1367,7 +1367,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveTaintOffNode(c, nodeName, taintName) defer framework.RemoveTaintOffNode(c, nodeName, taintName)
By("Trying to apply a random label on the found node.") By("Trying to apply a random label on the found node.")
labelKey := fmt.Sprintf("kubernetes.io/e2e-label-key-%s", string(util.NewUUID())) labelKey := fmt.Sprintf("kubernetes.io/e2e-label-key-%s", string(uuid.NewUUID()))
labelValue := "testing-label-value" labelValue := "testing-label-value"
framework.AddOrUpdateLabelOnNode(c, nodeName, labelKey, labelValue) framework.AddOrUpdateLabelOnNode(c, nodeName, labelKey, labelValue)
framework.ExpectNodeHasLabel(c, nodeName, labelKey, labelValue) framework.ExpectNodeHasLabel(c, nodeName, labelKey, labelValue)
......
...@@ -20,7 +20,7 @@ import ( ...@@ -20,7 +20,7 @@ import (
"fmt" "fmt"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -30,7 +30,7 @@ var _ = framework.KubeDescribe("Secrets", func() { ...@@ -30,7 +30,7 @@ var _ = framework.KubeDescribe("Secrets", func() {
f := framework.NewDefaultFramework("secrets") f := framework.NewDefaultFramework("secrets")
It("should be consumable from pods in volume [Conformance]", func() { It("should be consumable from pods in volume [Conformance]", func() {
name := "secret-test-" + string(util.NewUUID()) name := "secret-test-" + string(uuid.NewUUID())
volumeName := "secret-volume" volumeName := "secret-volume"
volumeMountPath := "/etc/secret-volume" volumeMountPath := "/etc/secret-volume"
secret := secretForTest(f.Namespace.Name, name) secret := secretForTest(f.Namespace.Name, name)
...@@ -49,7 +49,7 @@ var _ = framework.KubeDescribe("Secrets", func() { ...@@ -49,7 +49,7 @@ var _ = framework.KubeDescribe("Secrets", func() {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-secrets-" + string(util.NewUUID()), Name: "pod-secrets-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Volumes: []api.Volume{ Volumes: []api.Volume{
...@@ -93,7 +93,7 @@ var _ = framework.KubeDescribe("Secrets", func() { ...@@ -93,7 +93,7 @@ var _ = framework.KubeDescribe("Secrets", func() {
// volumes in the same pod. This test case exists to prevent // volumes in the same pod. This test case exists to prevent
// regressions that break this use-case. // regressions that break this use-case.
var ( var (
name = "secret-test-" + string(util.NewUUID()) name = "secret-test-" + string(uuid.NewUUID())
volumeName = "secret-volume" volumeName = "secret-volume"
volumeMountPath = "/etc/secret-volume" volumeMountPath = "/etc/secret-volume"
volumeName2 = "secret-volume-2" volumeName2 = "secret-volume-2"
...@@ -115,7 +115,7 @@ var _ = framework.KubeDescribe("Secrets", func() { ...@@ -115,7 +115,7 @@ var _ = framework.KubeDescribe("Secrets", func() {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-secrets-" + string(util.NewUUID()), Name: "pod-secrets-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Volumes: []api.Volume{ Volumes: []api.Volume{
...@@ -168,7 +168,7 @@ var _ = framework.KubeDescribe("Secrets", func() { ...@@ -168,7 +168,7 @@ var _ = framework.KubeDescribe("Secrets", func() {
}) })
It("should be consumable from pods in env vars [Conformance]", func() { It("should be consumable from pods in env vars [Conformance]", func() {
name := "secret-test-" + string(util.NewUUID()) name := "secret-test-" + string(uuid.NewUUID())
secret := secretForTest(f.Namespace.Name, name) secret := secretForTest(f.Namespace.Name, name)
By(fmt.Sprintf("Creating secret with name %s", secret.Name)) By(fmt.Sprintf("Creating secret with name %s", secret.Name))
...@@ -185,7 +185,7 @@ var _ = framework.KubeDescribe("Secrets", func() { ...@@ -185,7 +185,7 @@ var _ = framework.KubeDescribe("Secrets", func() {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-secrets-" + string(util.NewUUID()), Name: "pod-secrets-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Containers: []api.Container{ Containers: []api.Container{
......
...@@ -26,7 +26,7 @@ import ( ...@@ -26,7 +26,7 @@ import (
"fmt" "fmt"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -34,7 +34,7 @@ import ( ...@@ -34,7 +34,7 @@ import (
) )
func scTestPod(hostIPC bool, hostPID bool) *api.Pod { func scTestPod(hostIPC bool, hostPID bool) *api.Pod {
podName := "security-context-" + string(util.NewUUID()) podName := "security-context-" + string(uuid.NewUUID())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: podName, Name: podName,
......
...@@ -35,10 +35,10 @@ import ( ...@@ -35,10 +35,10 @@ import (
"k8s.io/kubernetes/pkg/controller/endpoint" "k8s.io/kubernetes/pkg/controller/endpoint"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/intstr"
utilnet "k8s.io/kubernetes/pkg/util/net" utilnet "k8s.io/kubernetes/pkg/util/net"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
) )
...@@ -1531,7 +1531,7 @@ func NewServiceTestJig(client *client.Client, name string) *ServiceTestJig { ...@@ -1531,7 +1531,7 @@ func NewServiceTestJig(client *client.Client, name string) *ServiceTestJig {
j := &ServiceTestJig{} j := &ServiceTestJig{}
j.Client = client j.Client = client
j.Name = name j.Name = name
j.ID = j.Name + "-" + string(util.NewUUID()) j.ID = j.Name + "-" + string(uuid.NewUUID())
j.Labels = map[string]string{"testid": j.ID} j.Labels = map[string]string{"testid": j.ID}
return j return j
...@@ -1881,7 +1881,7 @@ func NewServerTest(client *client.Client, namespace string, serviceName string) ...@@ -1881,7 +1881,7 @@ func NewServerTest(client *client.Client, namespace string, serviceName string)
t.Client = client t.Client = client
t.Namespace = namespace t.Namespace = namespace
t.ServiceName = serviceName t.ServiceName = serviceName
t.TestId = t.ServiceName + "-" + string(util.NewUUID()) t.TestId = t.ServiceName + "-" + string(uuid.NewUUID())
t.Labels = map[string]string{ t.Labels = map[string]string{
"testid": t.TestId, "testid": t.TestId,
} }
......
...@@ -22,7 +22,7 @@ import ( ...@@ -22,7 +22,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
apierrors "k8s.io/kubernetes/pkg/api/errors" apierrors "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/version" "k8s.io/kubernetes/pkg/version"
"k8s.io/kubernetes/plugin/pkg/admission/serviceaccount" "k8s.io/kubernetes/plugin/pkg/admission/serviceaccount"
...@@ -191,7 +191,7 @@ var _ = framework.KubeDescribe("ServiceAccounts", func() { ...@@ -191,7 +191,7 @@ var _ = framework.KubeDescribe("ServiceAccounts", func() {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-service-account-" + string(util.NewUUID()), Name: "pod-service-account-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Containers: []api.Container{ Containers: []api.Container{
......
...@@ -26,9 +26,9 @@ import ( ...@@ -26,9 +26,9 @@ import (
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
) )
...@@ -187,7 +187,7 @@ func checkZoneSpreading(c *client.Client, pods *api.PodList, zoneNames []string) ...@@ -187,7 +187,7 @@ func checkZoneSpreading(c *client.Client, pods *api.PodList, zoneNames []string)
// Check that the pods comprising a replication controller get spread evenly across available zones // Check that the pods comprising a replication controller get spread evenly across available zones
func SpreadRCOrFail(f *framework.Framework, replicaCount int32, image string) { func SpreadRCOrFail(f *framework.Framework, replicaCount int32, image string) {
name := "ubelite-spread-rc-" + string(util.NewUUID()) name := "ubelite-spread-rc-" + string(uuid.NewUUID())
By(fmt.Sprintf("Creating replication controller %s", name)) By(fmt.Sprintf("Creating replication controller %s", name))
controller, err := f.Client.ReplicationControllers(f.Namespace.Name).Create(&api.ReplicationController{ controller, err := f.Client.ReplicationControllers(f.Namespace.Name).Create(&api.ReplicationController{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
......
...@@ -18,7 +18,7 @@ package e2e_node ...@@ -18,7 +18,7 @@ package e2e_node
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -31,8 +31,8 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() { ...@@ -31,8 +31,8 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
Context("On enabling QOS cgroup hierarchy", func() { Context("On enabling QOS cgroup hierarchy", func() {
It("Top level QoS containers should have been created", func() { It("Top level QoS containers should have been created", func() {
if framework.TestContext.CgroupsPerQOS { if framework.TestContext.CgroupsPerQOS {
podName := "qos-pod" + string(util.NewUUID()) podName := "qos-pod" + string(uuid.NewUUID())
contName := "qos-container" + string(util.NewUUID()) contName := "qos-container" + string(uuid.NewUUID())
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: podName, Name: podName,
......
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"time" "time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -64,7 +64,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() { ...@@ -64,7 +64,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
// minute) plus additional time for fudge factor. // minute) plus additional time for fudge factor.
const podLogTimeout = 300 * time.Second const podLogTimeout = 300 * time.Second
name := "configmap-test-upd-" + string(util.NewUUID()) name := "configmap-test-upd-" + string(uuid.NewUUID())
volumeName := "configmap-volume" volumeName := "configmap-volume"
volumeMountPath := "/etc/configmap-volume" volumeMountPath := "/etc/configmap-volume"
containerName := "configmap-volume-test" containerName := "configmap-volume-test"
...@@ -88,7 +88,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() { ...@@ -88,7 +88,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()), Name: "pod-configmaps-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Volumes: []api.Volume{ Volumes: []api.Volume{
...@@ -141,7 +141,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() { ...@@ -141,7 +141,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
}) })
It("should be consumable via environment variable [Conformance]", func() { It("should be consumable via environment variable [Conformance]", func() {
name := "configmap-test-" + string(util.NewUUID()) name := "configmap-test-" + string(uuid.NewUUID())
configMap := newConfigMap(f, name) configMap := newConfigMap(f, name)
By(fmt.Sprintf("Creating configMap %v/%v", f.Namespace.Name, configMap.Name)) By(fmt.Sprintf("Creating configMap %v/%v", f.Namespace.Name, configMap.Name))
...@@ -152,7 +152,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() { ...@@ -152,7 +152,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()), Name: "pod-configmaps-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Containers: []api.Container{ Containers: []api.Container{
...@@ -204,7 +204,7 @@ func newConfigMap(f *framework.Framework, name string) *api.ConfigMap { ...@@ -204,7 +204,7 @@ func newConfigMap(f *framework.Framework, name string) *api.ConfigMap {
func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) { func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
var ( var (
name = "configmap-test-volume-" + string(util.NewUUID()) name = "configmap-test-volume-" + string(uuid.NewUUID())
volumeName = "configmap-volume" volumeName = "configmap-volume"
volumeMountPath = "/etc/configmap-volume" volumeMountPath = "/etc/configmap-volume"
configMap = newConfigMap(f, name) configMap = newConfigMap(f, name)
...@@ -219,7 +219,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) { ...@@ -219,7 +219,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()), Name: "pod-configmaps-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
SecurityContext: &api.PodSecurityContext{}, SecurityContext: &api.PodSecurityContext{},
...@@ -271,7 +271,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) { ...@@ -271,7 +271,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) { func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) {
var ( var (
name = "configmap-test-volume-map-" + string(util.NewUUID()) name = "configmap-test-volume-map-" + string(uuid.NewUUID())
volumeName = "configmap-volume" volumeName = "configmap-volume"
volumeMountPath = "/etc/configmap-volume" volumeMountPath = "/etc/configmap-volume"
configMap = newConfigMap(f, name) configMap = newConfigMap(f, name)
...@@ -286,7 +286,7 @@ func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) { ...@@ -286,7 +286,7 @@ func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()), Name: "pod-configmaps-" + string(uuid.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
SecurityContext: &api.PodSecurityContext{}, SecurityContext: &api.PodSecurityContext{},
......
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
) )
...@@ -39,7 +39,7 @@ type ConformanceContainer struct { ...@@ -39,7 +39,7 @@ type ConformanceContainer struct {
} }
func (cc *ConformanceContainer) Create() { func (cc *ConformanceContainer) Create() {
cc.podName = cc.Container.Name + string(util.NewUUID()) cc.podName = cc.Container.Name + string(uuid.NewUUID())
imagePullSecrets := []api.LocalObjectReference{} imagePullSecrets := []api.LocalObjectReference{}
for _, s := range cc.ImagePullSecrets { for _, s := range cc.ImagePullSecrets {
imagePullSecrets = append(imagePullSecrets, api.LocalObjectReference{Name: s}) imagePullSecrets = append(imagePullSecrets, api.LocalObjectReference{Name: s})
......
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"time" "time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -41,7 +41,7 @@ var _ = framework.KubeDescribe("Kubelet Container Manager", func() { ...@@ -41,7 +41,7 @@ var _ = framework.KubeDescribe("Kubelet Container Manager", func() {
var podName string var podName string
BeforeEach(func() { BeforeEach(func() {
podName = "bin-false" + string(util.NewUUID()) podName = "bin-false" + string(uuid.NewUUID())
podClient.Create(&api.Pod{ podClient.Create(&api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: podName, Name: podName,
......
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -32,7 +32,7 @@ import ( ...@@ -32,7 +32,7 @@ import (
var _ = framework.KubeDescribe("Downward API", func() { var _ = framework.KubeDescribe("Downward API", func() {
f := framework.NewDefaultFramework("downward-api") f := framework.NewDefaultFramework("downward-api")
It("should provide pod name and namespace as env vars [Conformance]", func() { It("should provide pod name and namespace as env vars [Conformance]", func() {
podName := "downward-api-" + string(util.NewUUID()) podName := "downward-api-" + string(uuid.NewUUID())
env := []api.EnvVar{ env := []api.EnvVar{
{ {
Name: "POD_NAME", Name: "POD_NAME",
...@@ -63,7 +63,7 @@ var _ = framework.KubeDescribe("Downward API", func() { ...@@ -63,7 +63,7 @@ var _ = framework.KubeDescribe("Downward API", func() {
}) })
It("should provide pod IP as an env var", func() { It("should provide pod IP as an env var", func() {
podName := "downward-api-" + string(util.NewUUID()) podName := "downward-api-" + string(uuid.NewUUID())
env := []api.EnvVar{ env := []api.EnvVar{
{ {
Name: "POD_IP", Name: "POD_IP",
...@@ -84,7 +84,7 @@ var _ = framework.KubeDescribe("Downward API", func() { ...@@ -84,7 +84,7 @@ var _ = framework.KubeDescribe("Downward API", func() {
}) })
It("should provide container's limits.cpu/memory and requests.cpu/memory as env vars", func() { It("should provide container's limits.cpu/memory and requests.cpu/memory as env vars", func() {
podName := "downward-api-" + string(util.NewUUID()) podName := "downward-api-" + string(uuid.NewUUID())
env := []api.EnvVar{ env := []api.EnvVar{
{ {
Name: "CPU_LIMIT", Name: "CPU_LIMIT",
......
...@@ -28,8 +28,8 @@ import ( ...@@ -28,8 +28,8 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
apiUnversioned "k8s.io/kubernetes/pkg/api/unversioned" apiUnversioned "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats" "k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
...@@ -44,7 +44,7 @@ var _ = framework.KubeDescribe("Kubelet", func() { ...@@ -44,7 +44,7 @@ var _ = framework.KubeDescribe("Kubelet", func() {
podClient = f.PodClient() podClient = f.PodClient()
}) })
Context("when scheduling a busybox command in a pod", func() { Context("when scheduling a busybox command in a pod", func() {
podName := "busybox-scheduling-" + string(util.NewUUID()) podName := "busybox-scheduling-" + string(uuid.NewUUID())
It("it should print the output to logs", func() { It("it should print the output to logs", func() {
podClient.CreateSync(&api.Pod{ podClient.CreateSync(&api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
...@@ -77,7 +77,7 @@ var _ = framework.KubeDescribe("Kubelet", func() { ...@@ -77,7 +77,7 @@ var _ = framework.KubeDescribe("Kubelet", func() {
}) })
Context("when scheduling a read only busybox container", func() { Context("when scheduling a read only busybox container", func() {
podName := "busybox-readonly-fs" + string(util.NewUUID()) podName := "busybox-readonly-fs" + string(uuid.NewUUID())
It("it should not write to root filesystem", func() { It("it should not write to root filesystem", func() {
isReadOnly := true isReadOnly := true
podClient.CreateSync(&api.Pod{ podClient.CreateSync(&api.Pod{
...@@ -114,7 +114,7 @@ var _ = framework.KubeDescribe("Kubelet", func() { ...@@ -114,7 +114,7 @@ var _ = framework.KubeDescribe("Kubelet", func() {
Describe("metrics api", func() { Describe("metrics api", func() {
Context("when querying /stats/summary", func() { Context("when querying /stats/summary", func() {
It("it should report resource usage through the stats api", func() { It("it should report resource usage through the stats api", func() {
podNamePrefix := "stats-busybox-" + string(util.NewUUID()) podNamePrefix := "stats-busybox-" + string(uuid.NewUUID())
volumeNamePrefix := "test-empty-dir" volumeNamePrefix := "test-empty-dir"
podNames, volumes := createSummaryTestPods(f.PodClient(), podNamePrefix, 2, volumeNamePrefix) podNames, volumes := createSummaryTestPods(f.PodClient(), podNamePrefix, 2, volumeNamePrefix)
By("Returning stats summary") By("Returning stats summary")
......
...@@ -27,7 +27,7 @@ import ( ...@@ -27,7 +27,7 @@ import (
"k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/errors"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -40,7 +40,7 @@ var _ = framework.KubeDescribe("MirrorPod", func() { ...@@ -40,7 +40,7 @@ var _ = framework.KubeDescribe("MirrorPod", func() {
var ns, staticPodName, mirrorPodName string var ns, staticPodName, mirrorPodName string
BeforeEach(func() { BeforeEach(func() {
ns = f.Namespace.Name ns = f.Namespace.Name
staticPodName = "static-pod-" + string(util.NewUUID()) staticPodName = "static-pod-" + string(uuid.NewUUID())
mirrorPodName = staticPodName + "-" + framework.TestContext.NodeName mirrorPodName = staticPodName + "-" + framework.TestContext.NodeName
By("create the static pod") By("create the static pod")
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/kubelet/images" "k8s.io/kubernetes/pkg/kubelet/images"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
...@@ -246,7 +246,7 @@ while true; do sleep 1; done ...@@ -246,7 +246,7 @@ while true; do sleep 1; done
RestartPolicy: api.RestartPolicyNever, RestartPolicy: api.RestartPolicyNever,
} }
if testCase.secret { if testCase.secret {
secret.Name = "image-pull-secret-" + string(util.NewUUID()) secret.Name = "image-pull-secret-" + string(uuid.NewUUID())
By("create image pull secret") By("create image pull secret")
_, err := f.Client.Secrets(f.Namespace.Name).Create(secret) _, err := f.Client.Secrets(f.Namespace.Name).Create(secret)
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment