Refactor uuid into its own pkg

pull/6/head
Harry Zhang 2016-07-26 11:13:18 -04:00
parent 5ab082dc14
commit c495397cae
56 changed files with 191 additions and 189 deletions

View File

@ -20,7 +20,7 @@ import (
"github.com/aws/aws-sdk-go/service/route53"
"k8s.io/kubernetes/federation/pkg/dnsprovider"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
)
// Compile time check for interface adeherence
@ -48,7 +48,7 @@ func (zones Zones) List() ([]dnsprovider.Zone, error) {
func (zones Zones) Add(zone dnsprovider.Zone) (dnsprovider.Zone, error) {
dnsName := zone.Name()
callerReference := string(util.NewUUID())
callerReference := string(uuid.NewUUID())
input := route53.CreateHostedZoneInput{Name: &dnsName, CallerReference: &callerReference}
output, err := zones.interface_.service.CreateHostedZone(&input)
if err != nil {
@ -67,7 +67,7 @@ func (zones Zones) Remove(zone dnsprovider.Zone) error {
return nil
}
func (zones Zones) New(name string) (dnsprovider.Zone, error) {
id := string(util.NewUUID())
id := string(uuid.NewUUID())
managedZone := route53.HostedZone{Id: &id, Name: &name}
return &Zone{&managedZone, &zones}, nil
}

View File

@ -21,7 +21,7 @@ import (
dns "google.golang.org/api/dns/v1"
"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
@ -46,6 +46,6 @@ func (m *ManagedZonesService) List(project string) interfaces.ManagedZonesListCa
}
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}}
}

View File

@ -32,14 +32,14 @@ import (
"k8s.io/kubernetes/pkg/client/restclient"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
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 {
cluster := federation_v1beta1.Cluster{
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()},
ObjectMeta: v1.ObjectMeta{
UID: util.NewUUID(),
UID: uuid.NewUUID(),
Name: clusterName,
},
Spec: federation_v1beta1.ClusterSpec{

View File

@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/conversion"
"k8s.io/kubernetes/pkg/runtime"
"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.
@ -33,7 +33,7 @@ func FillObjectMetaSystemFields(ctx Context, meta *ObjectMeta) {
// to support tracking resources pending creation.
uid, found := UIDFrom(ctx)
if !found {
uid = util.NewUUID()
uid = uuid.NewUUID()
}
meta.UID = uid
meta.SelfLink = ""

View File

@ -28,7 +28,7 @@ import (
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
)
var _ meta.Object = &api.ObjectMeta{}
@ -44,7 +44,7 @@ func TestFillObjectMetaSystemFields(t *testing.T) {
t.Errorf("resource.UID missing")
}
// verify we can inject a UID
uid := util.NewUUID()
uid := uuid.NewUUID()
ctx = api.WithUID(ctx, uid)
resource = api.ObjectMeta{}
api.FillObjectMetaSystemFields(ctx, &resource)

View File

@ -35,10 +35,10 @@ import (
"k8s.io/kubernetes/pkg/client/restclient"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/securitycontext"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/clock"
"k8s.io/kubernetes/pkg/util/sets"
utiltesting "k8s.io/kubernetes/pkg/util/testing"
"k8s.io/kubernetes/pkg/util/uuid"
)
// NewFakeControllerExpectationsLookup creates a fake store for PodExpectations.
@ -55,7 +55,7 @@ func newReplicationController(replicas int) *api.ReplicationController {
rc := &api.ReplicationController{
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()},
ObjectMeta: api.ObjectMeta{
UID: util.NewUUID(),
UID: uuid.NewUUID(),
Name: "foobar",
Namespace: api.NamespaceDefault,
ResourceVersion: "18",

View File

@ -29,8 +29,8 @@ import (
"k8s.io/kubernetes/pkg/client/testing/core"
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/uuid"
)
var (
@ -90,7 +90,7 @@ func newDeployment(replicas int, revisionHistoryLimit *int) *exp.Deployment {
d := exp.Deployment{
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()},
ObjectMeta: api.ObjectMeta{
UID: util.NewUUID(),
UID: uuid.NewUUID(),
Name: "foobar",
Namespace: api.NamespaceDefault,
ResourceVersion: "18",

View File

@ -38,9 +38,9 @@ import (
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/securitycontext"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets"
utiltesting "k8s.io/kubernetes/pkg/util/testing"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/watch"
)
@ -60,7 +60,7 @@ func newReplicaSet(replicas int, selectorMap map[string]string) *extensions.Repl
rs := &extensions.ReplicaSet{
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()},
ObjectMeta: api.ObjectMeta{
UID: util.NewUUID(),
UID: uuid.NewUUID(),
Name: "foobar",
Namespace: api.NamespaceDefault,
ResourceVersion: "18",
@ -958,7 +958,7 @@ func TestOverlappingRSs(t *testing.T) {
for j := 1; j < 10; j++ {
rsSpec := newReplicaSet(1, labelMap)
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)
}
shuffledControllers := shuffle(controllers)
@ -1083,7 +1083,7 @@ func TestDoNotPatchPodWithOtherControlRef(t *testing.T) {
rs := newReplicaSet(2, labelMap)
manager.rsStore.Store.Add(rs)
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.
pod := newPod("pod", rs, api.PodRunning)
pod.OwnerReferences = []api.OwnerReference{otherControllerReference}
@ -1104,7 +1104,7 @@ func TestPatchPodWithOtherOwnerRef(t *testing.T) {
// 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
// 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.OwnerReferences = []api.OwnerReference{unrelatedOwnerReference}
manager.podStore.Indexer.Add(pod)

View File

@ -37,9 +37,9 @@ import (
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/securitycontext"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets"
utiltesting "k8s.io/kubernetes/pkg/util/testing"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/watch"
)
@ -59,7 +59,7 @@ func newReplicationController(replicas int) *api.ReplicationController {
rc := &api.ReplicationController{
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Default.GroupVersion().String()},
ObjectMeta: api.ObjectMeta{
UID: util.NewUUID(),
UID: uuid.NewUUID(),
Name: "foobar",
Namespace: api.NamespaceDefault,
ResourceVersion: "18",
@ -937,7 +937,7 @@ func TestOverlappingRCs(t *testing.T) {
for j := 1; j < 10; j++ {
controllerSpec := newReplicationController(1)
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)
}
shuffledControllers := shuffle(controllers)
@ -1145,7 +1145,7 @@ func TestDoNotPatchPodWithOtherControlRef(t *testing.T) {
rc := newReplicationController(2)
manager.rcStore.Indexer.Add(rc)
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.
pod := newPod("pod", rc, api.PodRunning)
pod.OwnerReferences = []api.OwnerReference{otherControllerReference}
@ -1165,7 +1165,7 @@ func TestPatchPodWithOtherOwnerRef(t *testing.T) {
// 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
// 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.OwnerReferences = []api.OwnerReference{unrelatedOwnerReference}
manager.podStore.Indexer.Add(pod)

View File

@ -32,6 +32,7 @@ import (
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util"
utilerrors "k8s.io/kubernetes/pkg/util/errors"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait"
)
@ -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
// the DaemonSet.
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
ds.ResourceVersion = ""

View File

@ -35,9 +35,9 @@ import (
"k8s.io/kubernetes/pkg/client/testing/core"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/diff"
"k8s.io/kubernetes/pkg/util/rand"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/version"
)
@ -48,7 +48,7 @@ func generateTestingImageList(count int) ([]kubecontainer.Image, []api.Container
var imageList []kubecontainer.Image
for ; count > 0; count-- {
imageItem := kubecontainer.Image{
ID: string(util.NewUUID()),
ID: string(uuid.NewUUID()),
RepoTags: generateImageTags(),
Size: rand.Int63nRange(minImgSize, maxImgSize+1),
}

View File

@ -56,13 +56,13 @@ import (
"k8s.io/kubernetes/pkg/kubelet/util/format"
"k8s.io/kubernetes/pkg/securitycontext"
kubetypes "k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/errors"
utilexec "k8s.io/kubernetes/pkg/util/exec"
"k8s.io/kubernetes/pkg/util/flowcontrol"
"k8s.io/kubernetes/pkg/util/selinux"
utilstrings "k8s.io/kubernetes/pkg/util/strings"
"k8s.io/kubernetes/pkg/util/term"
"k8s.io/kubernetes/pkg/util/uuid"
utilwait "k8s.io/kubernetes/pkg/util/wait"
)
@ -726,7 +726,7 @@ func (r *Runtime) makeContainerLogMount(opts *kubecontainer.RunContainerOptions,
// 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
// on the disk.
randomUID := util.NewUUID()
randomUID := uuid.NewUUID()
containerLogPath := path.Join(opts.PodContainerDir, string(randomUID))
fs, err := r.os.Create(containerLogPath)
if err != nil {

View File

@ -25,7 +25,7 @@ import (
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/registry/generic"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/validation/field"
)
@ -45,7 +45,7 @@ func (limitrangeStrategy) NamespaceScoped() bool {
func (limitrangeStrategy) PrepareForCreate(obj runtime.Object) {
limitRange := obj.(*api.LimitRange)
if len(limitRange.Name) == 0 {
limitRange.Name = string(util.NewUUID())
limitRange.Name = string(uuid.NewUUID())
}
}

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package util
package uuid
import (
"sync"

View File

@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/volume"
)
@ -262,7 +262,7 @@ type hostPathProvisioner struct {
// 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.
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{
ObjectMeta: api.ObjectMeta{

View File

@ -28,6 +28,7 @@ import (
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/fake"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/volume"
volumetest "k8s.io/kubernetes/pkg/volume/testing"
)
@ -91,7 +92,7 @@ func TestRecycler(t *testing.T) {
func TestDeleter(t *testing.T) {
// 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)
err := os.MkdirAll(tempPath, 0750)
if err != nil {
@ -148,7 +149,7 @@ func TestDeleterTempDir(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)
err := os.MkdirAll(tempPath, 0750)

View File

@ -32,11 +32,11 @@ import (
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
"k8s.io/kubernetes/pkg/cloudprovider"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/io"
"k8s.io/kubernetes/pkg/util/mount"
utilstrings "k8s.io/kubernetes/pkg/util/strings"
utiltesting "k8s.io/kubernetes/pkg/util/testing"
"k8s.io/kubernetes/pkg/util/uuid"
. "k8s.io/kubernetes/pkg/volume"
)
@ -474,7 +474,7 @@ type FakeProvisioner struct {
}
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{
ObjectMeta: api.ObjectMeta{

View File

@ -21,8 +21,8 @@ import (
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -124,7 +124,7 @@ func getRestartCount(p *api.Pod) int {
func makePodSpec(readinessProbe, livenessProbe *api.Probe) *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{
Containers: []api.Container{
{

View File

@ -21,7 +21,7 @@ import (
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -63,7 +63,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
// minute) plus additional time for fudge factor.
const podLogTimeout = 300 * time.Second
name := "configmap-test-upd-" + string(util.NewUUID())
name := "configmap-test-upd-" + string(uuid.NewUUID())
volumeName := "configmap-volume"
volumeMountPath := "/etc/configmap-volume"
containerName := "configmap-volume-test"
@ -92,7 +92,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()),
Name: "pod-configmaps-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
Volumes: []api.Volume{
@ -152,7 +152,7 @@ var _ = framework.KubeDescribe("ConfigMap", 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)
By(fmt.Sprintf("Creating configMap %v/%v", f.Namespace.Name, configMap.Name))
defer func() {
@ -168,7 +168,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()),
Name: "pod-configmaps-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
Containers: []api.Container{
@ -202,7 +202,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
It("should be consumable in multiple volumes in the same pod", func() {
var (
name = "configmap-test-volume-" + string(util.NewUUID())
name = "configmap-test-volume-" + string(uuid.NewUUID())
volumeName = "configmap-volume"
volumeMountPath = "/etc/configmap-volume"
volumeName2 = "configmap-volume-2"
@ -224,7 +224,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()),
Name: "pod-configmaps-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
Volumes: []api.Volume{
@ -295,7 +295,7 @@ func newConfigMap(f *framework.Framework, name string) *api.ConfigMap {
func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
var (
name = "configmap-test-volume-" + string(util.NewUUID())
name = "configmap-test-volume-" + string(uuid.NewUUID())
volumeName = "configmap-volume"
volumeMountPath = "/etc/configmap-volume"
configMap = newConfigMap(f, name)
@ -315,7 +315,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()),
Name: "pod-configmaps-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
SecurityContext: &api.PodSecurityContext{},
@ -365,7 +365,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) {
var (
name = "configmap-test-volume-map-" + string(util.NewUUID())
name = "configmap-test-volume-map-" + string(uuid.NewUUID())
volumeName = "configmap-volume"
volumeMountPath = "/etc/configmap-volume"
configMap = newConfigMap(f, name)
@ -385,7 +385,7 @@ func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()),
Name: "pod-configmaps-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
SecurityContext: &api.PodSecurityContext{},

View File

@ -28,8 +28,8 @@ import (
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/master/ports"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/watch"
"k8s.io/kubernetes/test/e2e/framework"
@ -187,7 +187,7 @@ func getContainerRestarts(c *client.Client, ns string, labelSelector labels.Sele
var _ = framework.KubeDescribe("DaemonRestart [Disruptive]", func() {
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()
existingPods := cache.NewStore(cache.MetaNamespaceKeyFunc)
var ns string

View File

@ -34,7 +34,7 @@ import (
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels"
"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/test/e2e/framework"
@ -242,7 +242,7 @@ var _ = framework.KubeDescribe("Density", func() {
err := framework.CheckTestingNSDeletedExcept(c, ns)
framework.ExpectNoError(err)
uuid = string(util.NewUUID())
uuid = string(utiluuid.NewUUID())
framework.ExpectNoError(framework.ResetMetrics(c))
framework.ExpectNoError(os.Mkdir(fmt.Sprintf(framework.TestContext.OutputDir+"/%s", uuid), 0777))

View File

@ -29,7 +29,7 @@ import (
"k8s.io/kubernetes/pkg/apimachinery/registered"
client "k8s.io/kubernetes/pkg/client/unversioned"
"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/test/e2e/framework"
)
@ -49,7 +49,7 @@ func createDNSPod(namespace, wheezyProbeCmd, jessieProbeCmd string, useAnnotatio
APIVersion: registered.GroupOrDie(api.GroupName).GroupVersion.String(),
},
ObjectMeta: api.ObjectMeta{
Name: "dns-test-" + string(util.NewUUID()),
Name: "dns-test-" + string(uuid.NewUUID()),
Namespace: namespace,
},
Spec: api.PodSpec{

View File

@ -19,7 +19,7 @@ package e2e
import (
"k8s.io/kubernetes/pkg/api"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -76,7 +76,7 @@ const testContainerName = "test-container"
// Return a prototypical entrypoint test pod
func entrypointTestPod() *api.Pod {
podName := "client-containers-" + string(util.NewUUID())
podName := "client-containers-" + string(uuid.NewUUID())
return &api.Pod{
ObjectMeta: api.ObjectMeta{

View File

@ -21,7 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -31,7 +31,7 @@ var _ = framework.KubeDescribe("Downward API", func() {
f := framework.NewDefaultFramework("downward-api")
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{
{
Name: "POD_NAME",
@ -62,7 +62,7 @@ var _ = framework.KubeDescribe("Downward API", 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{
{
Name: "POD_IP",
@ -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() {
podName := "downward-api-" + string(util.NewUUID())
podName := "downward-api-" + string(uuid.NewUUID())
env := []api.EnvVar{
{
Name: "CPU_LIMIT",
@ -129,7 +129,7 @@ var _ = framework.KubeDescribe("Downward API", 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{
{
Name: "CPU_LIMIT",

View File

@ -22,7 +22,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -35,7 +35,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
f := framework.NewDefaultFramework("downward-api")
It("should provide podname only [Conformance]", func() {
podName := "downwardapi-volume-" + string(util.NewUUID())
podName := "downwardapi-volume-" + string(uuid.NewUUID())
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podname")
framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{
@ -44,7 +44,7 @@ var _ = framework.KubeDescribe("Downward API volume", 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)
gid := int64(1234)
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podname")
@ -62,7 +62,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
labels["key1"] = "value1"
labels["key2"] = "value2"
podName := "labelsupdate" + string(util.NewUUID())
podName := "labelsupdate" + string(uuid.NewUUID())
pod := downwardAPIVolumePodForUpdateTest(podName, labels, map[string]string{}, "/etc/labels")
containerName := "client-container"
defer func() {
@ -94,7 +94,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
It("should update annotations on modification [Conformance]", func() {
annotations := map[string]string{}
annotations["builder"] = "bar"
podName := "annotationupdate" + string(util.NewUUID())
podName := "annotationupdate" + string(uuid.NewUUID())
pod := downwardAPIVolumePodForUpdateTest(podName, map[string]string{}, annotations, "/etc/annotations")
containerName := "client-container"
@ -127,7 +127,7 @@ var _ = framework.KubeDescribe("Downward API volume", 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")
framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{
@ -136,7 +136,7 @@ var _ = framework.KubeDescribe("Downward API volume", 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")
framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{
@ -145,7 +145,7 @@ var _ = framework.KubeDescribe("Downward API volume", 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")
framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{
@ -154,7 +154,7 @@ var _ = framework.KubeDescribe("Downward API volume", 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")
framework.TestContainerOutput("downward API volume plugin", f.Client, pod, 0, []string{

View File

@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apimachinery/registered"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -311,7 +311,7 @@ func formatMedium(medium api.StorageMedium) string {
}
func testPodWithVolume(image, path string, source *api.EmptyDirVolumeSource) *api.Pod {
podName := "pod-" + string(util.NewUUID())
podName := "pod-" + string(uuid.NewUUID())
return &api.Pod{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",

View File

@ -18,8 +18,8 @@ package e2e
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
"strconv"
@ -33,7 +33,7 @@ var _ = framework.KubeDescribe("EmptyDir wrapper volumes", func() {
f := framework.NewDefaultFramework("emptydir-wrapper")
It("should becomes running", func() {
name := "emptydir-wrapper-test-" + string(util.NewUUID())
name := "emptydir-wrapper-test-" + string(uuid.NewUUID())
volumeName := "secret-volume"
volumeMountPath := "/etc/secret-volume"
@ -52,7 +52,7 @@ var _ = framework.KubeDescribe("EmptyDir wrapper volumes", func() {
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
labels := map[string]string{"name": gitServerPodName}
@ -110,7 +110,7 @@ var _ = framework.KubeDescribe("EmptyDir wrapper volumes", func() {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-secrets-" + string(util.NewUUID()),
Name: "pod-secrets-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
Volumes: []api.Volume{

View File

@ -24,7 +24,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/fields"
"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/test/e2e/framework"
@ -40,7 +40,7 @@ var _ = framework.KubeDescribe("Events", func() {
podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod")
name := "send-events-" + string(util.NewUUID())
name := "send-events-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{

View File

@ -18,7 +18,7 @@ package e2e
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -30,7 +30,7 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
f := framework.NewDefaultFramework("var-expansion")
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{
ObjectMeta: api.ObjectMeta{
Name: podName,
@ -70,7 +70,7 @@ var _ = framework.KubeDescribe("Variable Expansion", 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{
ObjectMeta: api.ObjectMeta{
Name: podName,
@ -100,7 +100,7 @@ var _ = framework.KubeDescribe("Variable Expansion", 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{
ObjectMeta: api.ObjectMeta{
Name: podName,

View File

@ -64,9 +64,9 @@ import (
"k8s.io/kubernetes/pkg/runtime"
sshutil "k8s.io/kubernetes/pkg/ssh"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
labelsutil "k8s.io/kubernetes/pkg/util/labels"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait"
utilyaml "k8s.io/kubernetes/pkg/util/yaml"
"k8s.io/kubernetes/pkg/version"
@ -212,7 +212,7 @@ func GetServicesProxyRequest(c *client.Client, request *restclient.Request) (*re
}
// 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)
@ -2603,7 +2603,7 @@ func StartPods(c *client.Client, replicas int, namespace string, podNamePrefix s
if replicas < 1 {
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++ {
podName := fmt.Sprintf("%v-%v", podNamePrefix, i)
pod.ObjectMeta.Name = podName

View File

@ -25,8 +25,8 @@ import (
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/watch"
"k8s.io/kubernetes/test/e2e/framework"
@ -101,7 +101,7 @@ var _ = framework.KubeDescribe("Generated release_1_2 clientset", func() {
It("should create pods, delete pods, watch pods", func() {
podClient := f.Clientset_1_2.Core().Pods(f.Namespace.Name)
By("constructing the pod")
name := "pod" + string(util.NewUUID())
name := "pod" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond())
podCopy := testingPod(name, value)
pod := &podCopy
@ -175,7 +175,7 @@ var _ = framework.KubeDescribe("Generated release_1_3 clientset", func() {
It("should create pods, delete pods, watch pods", func() {
podClient := f.Clientset_1_3.Core().Pods(f.Namespace.Name)
By("constructing the pod")
name := "pod" + string(util.NewUUID())
name := "pod" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond())
podCopy := testingPod(name, value)
pod := &podCopy

View File

@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apimachinery/registered"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -69,7 +69,7 @@ func testPodWithSsd(command string) *api.Pod {
containerName := "test-container"
volumeName := "test-ssd-volume"
path := "/mnt/disks/ssd0"
podName := "pod-" + string(util.NewUUID())
podName := "pod-" + string(uuid.NewUUID())
image := "ubuntu:14.04"
return &api.Pod{
TypeMeta: unversioned.TypeMeta{

View File

@ -51,8 +51,8 @@ import (
"k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/registry/generic/registry"
pkgutil "k8s.io/kubernetes/pkg/util"
utilnet "k8s.io/kubernetes/pkg/util/net"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/version"
"k8s.io/kubernetes/test/e2e/framework"
@ -1169,7 +1169,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
framework.KubeDescribe("Kubectl taint", 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"
taintEffect := fmt.Sprintf("%s", api.TaintEffectNoSchedule)

View File

@ -23,8 +23,8 @@ import (
"k8s.io/kubernetes/pkg/api"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework"
@ -183,7 +183,7 @@ var _ = framework.KubeDescribe("kubelet", func() {
It(name, func() {
totalPods := itArg.podsPerNode * numNodes
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{
Client: f.Client,

View File

@ -24,8 +24,8 @@ import (
"k8s.io/kubernetes/pkg/api"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -65,7 +65,7 @@ func runResourceTrackingTest(f *framework.Framework, podsPerNode int, nodeNames
numNodes := nodeNames.Len()
totalPods := podsPerNode * numNodes
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
Expect(framework.RunRC(framework.RCConfig{

View File

@ -32,9 +32,9 @@ import (
"k8s.io/kubernetes/pkg/apimachinery/registered"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr"
utilnet "k8s.io/kubernetes/pkg/util/net"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework"
)
@ -457,7 +457,7 @@ func (config *KubeProxyTestConfig) createService(serviceSpec *api.Service) *api.
func (config *KubeProxyTestConfig) setup() {
By("creating a selector")
selectorName := "selector-" + string(util.NewUUID())
selectorName := "selector-" + string(uuid.NewUUID())
serviceSelector := map[string]string{
selectorName: "true",
}

View File

@ -25,8 +25,8 @@ import (
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/system"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -47,7 +47,7 @@ var _ = framework.KubeDescribe("NodeProblemDetector", func() {
BeforeEach(func() {
c = f.Client
ns = f.Namespace.Name
uid = string(util.NewUUID())
uid = string(uuid.NewUUID())
name = "node-problem-detector-" + uid
configName = "node-problem-detector-config-" + uid
// There is no namespace for Node, event recorder will set default namespace for node events.

View File

@ -37,7 +37,7 @@ import (
client "k8s.io/kubernetes/pkg/client/unversioned"
awscloud "k8s.io/kubernetes/pkg/cloudprovider/providers/aws"
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"
)
@ -461,7 +461,7 @@ func verifyPDContentsViaContainer(f *framework.Framework, podName, containerName
func createPD() (string, error) {
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()
if err != nil {
@ -604,7 +604,7 @@ func testPDPod(diskNames []string, targetHost string, readOnly bool, numContaine
APIVersion: registered.GroupOrDie(api.GroupName).GroupVersion.String(),
},
ObjectMeta: api.ObjectMeta{
Name: "pd-test-" + string(util.NewUUID()),
Name: "pd-test-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
Containers: containers,

View File

@ -23,7 +23,7 @@ import (
. "github.com/onsi/ginkgo"
"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/test/e2e/framework"
)
@ -79,7 +79,7 @@ var _ = framework.KubeDescribe("Garbage collector [Feature:GarbageCollector] [Sl
})
func createTerminatingPod(f *framework.Framework) (*api.Pod, error) {
uuid := util.NewUUID()
uuid := uuid.NewUUID()
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: string(uuid),

View File

@ -31,8 +31,8 @@ import (
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/kubelet"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/watch"
"k8s.io/kubernetes/test/e2e/framework"
@ -210,7 +210,7 @@ var _ = framework.KubeDescribe("Pods", func() {
f := framework.NewDefaultFramework("pods")
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{
ObjectMeta: api.ObjectMeta{
Name: name,
@ -230,7 +230,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod")
name := "pod-update-" + string(util.NewUUID())
name := "pod-update-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
@ -267,7 +267,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod")
name := "pod-update-" + string(util.NewUUID())
name := "pod-update-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
@ -414,7 +414,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod")
name := "pod-update-" + string(util.NewUUID())
name := "pod-update-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
@ -482,7 +482,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod")
name := "pod-update-activedeadlineseconds-" + string(util.NewUUID())
name := "pod-update-activedeadlineseconds-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
@ -542,7 +542,7 @@ var _ = framework.KubeDescribe("Pods", func() {
It("should contain environment variables for services [Conformance]", func() {
// Make a pod that will be a service.
// This pod serves its hostname via HTTP.
serverName := "server-envvars-" + string(util.NewUUID())
serverName := "server-envvars-" + string(uuid.NewUUID())
serverPod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: serverName,
@ -597,7 +597,7 @@ var _ = framework.KubeDescribe("Pods", func() {
}
// 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{
ObjectMeta: api.ObjectMeta{
Name: podName,
@ -631,7 +631,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod")
name := "pod-init-" + string(util.NewUUID())
name := "pod-init-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
@ -697,7 +697,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod")
name := "pod-init-" + string(util.NewUUID())
name := "pod-init-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
@ -767,7 +767,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod")
name := "pod-init-" + string(util.NewUUID())
name := "pod-init-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
@ -883,7 +883,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod")
name := "pod-init-" + string(util.NewUUID())
name := "pod-init-" + string(uuid.NewUUID())
value := strconv.Itoa(time.Now().Nanosecond())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
@ -1142,7 +1142,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod")
name := "pod-exec-websocket-" + string(util.NewUUID())
name := "pod-exec-websocket-" + string(uuid.NewUUID())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: name,
@ -1221,7 +1221,7 @@ var _ = framework.KubeDescribe("Pods", func() {
podClient := f.Client.Pods(f.Namespace.Name)
By("creating the pod")
name := "pod-logs-websocket-" + string(util.NewUUID())
name := "pod-logs-websocket-" + string(uuid.NewUUID())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: name,

View File

@ -22,7 +22,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"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/test/e2e/framework"
@ -49,7 +49,7 @@ var _ = framework.KubeDescribe("ReplicationController", func() {
// a replication controller. The image serves its hostname
// which is checked for each replica.
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)
// Create a replication controller for a service

View File

@ -24,7 +24,7 @@ import (
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/extensions"
"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/test/e2e/framework"
@ -50,7 +50,7 @@ var _ = framework.KubeDescribe("ReplicaSet", func() {
// A basic test to check the deployment of an image using a ReplicaSet. The
// image serves its hostname which is checked for each replica.
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)
// Create a ReplicaSet for a service that serves its hostname.

View File

@ -25,9 +25,9 @@ import (
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/system"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -464,7 +464,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
framework.ExpectNoError(err)
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"
framework.AddOrUpdateLabelOnNode(c, nodeName, k, v)
framework.ExpectNodeHasLabel(c, nodeName, k, v)
@ -597,7 +597,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
framework.ExpectNoError(err)
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"
framework.AddOrUpdateLabelOnNode(c, nodeName, k, v)
framework.ExpectNodeHasLabel(c, nodeName, k, v)
@ -714,7 +714,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// part of podAffinity,so validation fails.
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.")
podName := "without-label-" + string(util.NewUUID())
podName := "without-label-" + string(uuid.NewUUID())
_, err := c.Pods(ns).Create(&api.Pod{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
@ -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.
It("validates that Inter-pod-Affinity is respected if not matching [Feature:PodAffinity]", func() {
By("Trying to schedule Pod with nonempty Pod Affinity.")
podName := "without-label-" + string(util.NewUUID())
podName := "without-label-" + string(uuid.NewUUID())
waitForStableCluster(c)
@ -816,7 +816,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// cluster and the scheduler it might be that a "normal" pod cannot be
// scheduled onto 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{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
@ -849,7 +849,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveLabelOffNode(c, nodeName, k)
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{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
@ -902,7 +902,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// cluster and the scheduler it might be that a "normal" pod cannot be
// scheduled onto 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{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
@ -935,7 +935,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveLabelOffNode(c, nodeName, k)
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{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
@ -986,7 +986,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// cluster and the scheduler it might be that a "normal" pod cannot be
// scheduled onto 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{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
@ -1019,7 +1019,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveLabelOffNode(c, nodeName, k)
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{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
@ -1080,7 +1080,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// cluster and the scheduler it might be that a "normal" pod cannot be
// scheduled onto 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{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
@ -1113,7 +1113,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveLabelOffNode(c, nodeName, k)
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{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
@ -1177,7 +1177,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
// cluster and the scheduler it might be that a "normal" pod cannot be
// scheduled onto 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{
TypeMeta: unversioned.TypeMeta{
Kind: "Pod",
@ -1264,7 +1264,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
framework.ExpectNoError(err)
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"
taintEffect := api.TaintEffectNoSchedule
framework.AddOrUpdateTaintOnNode(c, nodeName, api.Taint{Key: taintName, Value: taintValue, Effect: taintEffect})
@ -1272,7 +1272,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveTaintOffNode(c, nodeName, taintName)
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"
framework.AddOrUpdateLabelOnNode(c, nodeName, labelKey, labelValue)
framework.ExpectNodeHasLabel(c, nodeName, labelKey, labelValue)
@ -1359,7 +1359,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
framework.ExpectNoError(err)
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"
taintEffect := api.TaintEffectNoSchedule
framework.AddOrUpdateTaintOnNode(c, nodeName, api.Taint{Key: taintName, Value: taintValue, Effect: taintEffect})
@ -1367,7 +1367,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
defer framework.RemoveTaintOffNode(c, nodeName, taintName)
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"
framework.AddOrUpdateLabelOnNode(c, nodeName, labelKey, labelValue)
framework.ExpectNodeHasLabel(c, nodeName, labelKey, labelValue)

View File

@ -20,7 +20,7 @@ import (
"fmt"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -30,7 +30,7 @@ var _ = framework.KubeDescribe("Secrets", func() {
f := framework.NewDefaultFramework("secrets")
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"
volumeMountPath := "/etc/secret-volume"
secret := secretForTest(f.Namespace.Name, name)
@ -49,7 +49,7 @@ var _ = framework.KubeDescribe("Secrets", func() {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-secrets-" + string(util.NewUUID()),
Name: "pod-secrets-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
Volumes: []api.Volume{
@ -93,7 +93,7 @@ var _ = framework.KubeDescribe("Secrets", func() {
// volumes in the same pod. This test case exists to prevent
// regressions that break this use-case.
var (
name = "secret-test-" + string(util.NewUUID())
name = "secret-test-" + string(uuid.NewUUID())
volumeName = "secret-volume"
volumeMountPath = "/etc/secret-volume"
volumeName2 = "secret-volume-2"
@ -115,7 +115,7 @@ var _ = framework.KubeDescribe("Secrets", func() {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-secrets-" + string(util.NewUUID()),
Name: "pod-secrets-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
Volumes: []api.Volume{
@ -168,7 +168,7 @@ var _ = framework.KubeDescribe("Secrets", 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)
By(fmt.Sprintf("Creating secret with name %s", secret.Name))
@ -185,7 +185,7 @@ var _ = framework.KubeDescribe("Secrets", func() {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-secrets-" + string(util.NewUUID()),
Name: "pod-secrets-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
Containers: []api.Container{

View File

@ -26,7 +26,7 @@ import (
"fmt"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -34,7 +34,7 @@ import (
)
func scTestPod(hostIPC bool, hostPID bool) *api.Pod {
podName := "security-context-" + string(util.NewUUID())
podName := "security-context-" + string(uuid.NewUUID())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: podName,

View File

@ -35,10 +35,10 @@ import (
"k8s.io/kubernetes/pkg/controller/endpoint"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr"
utilnet "k8s.io/kubernetes/pkg/util/net"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework"
)
@ -1531,7 +1531,7 @@ func NewServiceTestJig(client *client.Client, name string) *ServiceTestJig {
j := &ServiceTestJig{}
j.Client = client
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}
return j
@ -1881,7 +1881,7 @@ func NewServerTest(client *client.Client, namespace string, serviceName string)
t.Client = client
t.Namespace = namespace
t.ServiceName = serviceName
t.TestId = t.ServiceName + "-" + string(util.NewUUID())
t.TestId = t.ServiceName + "-" + string(uuid.NewUUID())
t.Labels = map[string]string{
"testid": t.TestId,
}

View File

@ -22,7 +22,7 @@ import (
"k8s.io/kubernetes/pkg/api"
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/version"
"k8s.io/kubernetes/plugin/pkg/admission/serviceaccount"
@ -191,7 +191,7 @@ var _ = framework.KubeDescribe("ServiceAccounts", func() {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-service-account-" + string(util.NewUUID()),
Name: "pod-service-account-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
Containers: []api.Container{

View File

@ -26,9 +26,9 @@ import (
"k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
)
@ -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
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))
controller, err := f.Client.ReplicationControllers(f.Namespace.Name).Create(&api.ReplicationController{
ObjectMeta: api.ObjectMeta{

View File

@ -18,7 +18,7 @@ package e2e_node
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -31,8 +31,8 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
Context("On enabling QOS cgroup hierarchy", func() {
It("Top level QoS containers should have been created", func() {
if framework.TestContext.CgroupsPerQOS {
podName := "qos-pod" + string(util.NewUUID())
contName := "qos-container" + string(util.NewUUID())
podName := "qos-pod" + string(uuid.NewUUID())
contName := "qos-container" + string(uuid.NewUUID())
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: podName,

View File

@ -21,7 +21,7 @@ import (
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -64,7 +64,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
// minute) plus additional time for fudge factor.
const podLogTimeout = 300 * time.Second
name := "configmap-test-upd-" + string(util.NewUUID())
name := "configmap-test-upd-" + string(uuid.NewUUID())
volumeName := "configmap-volume"
volumeMountPath := "/etc/configmap-volume"
containerName := "configmap-volume-test"
@ -88,7 +88,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()),
Name: "pod-configmaps-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
Volumes: []api.Volume{
@ -141,7 +141,7 @@ var _ = framework.KubeDescribe("ConfigMap", 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)
By(fmt.Sprintf("Creating configMap %v/%v", f.Namespace.Name, configMap.Name))
@ -152,7 +152,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()),
Name: "pod-configmaps-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
Containers: []api.Container{
@ -204,7 +204,7 @@ func newConfigMap(f *framework.Framework, name string) *api.ConfigMap {
func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
var (
name = "configmap-test-volume-" + string(util.NewUUID())
name = "configmap-test-volume-" + string(uuid.NewUUID())
volumeName = "configmap-volume"
volumeMountPath = "/etc/configmap-volume"
configMap = newConfigMap(f, name)
@ -219,7 +219,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()),
Name: "pod-configmaps-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
SecurityContext: &api.PodSecurityContext{},
@ -271,7 +271,7 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64) {
func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) {
var (
name = "configmap-test-volume-map-" + string(util.NewUUID())
name = "configmap-test-volume-map-" + string(uuid.NewUUID())
volumeName = "configmap-volume"
volumeMountPath = "/etc/configmap-volume"
configMap = newConfigMap(f, name)
@ -286,7 +286,7 @@ func doConfigMapE2EWithMappings(f *framework.Framework, uid, fsGroup int64) {
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "pod-configmaps-" + string(util.NewUUID()),
Name: "pod-configmaps-" + string(uuid.NewUUID()),
},
Spec: api.PodSpec{
SecurityContext: &api.PodSecurityContext{},

View File

@ -21,7 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
)
@ -39,7 +39,7 @@ type ConformanceContainer struct {
}
func (cc *ConformanceContainer) Create() {
cc.podName = cc.Container.Name + string(util.NewUUID())
cc.podName = cc.Container.Name + string(uuid.NewUUID())
imagePullSecrets := []api.LocalObjectReference{}
for _, s := range cc.ImagePullSecrets {
imagePullSecrets = append(imagePullSecrets, api.LocalObjectReference{Name: s})

View File

@ -21,7 +21,7 @@ import (
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -41,7 +41,7 @@ var _ = framework.KubeDescribe("Kubelet Container Manager", func() {
var podName string
BeforeEach(func() {
podName = "bin-false" + string(util.NewUUID())
podName = "bin-false" + string(uuid.NewUUID())
podClient.Create(&api.Pod{
ObjectMeta: api.ObjectMeta{
Name: podName,

View File

@ -21,7 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -32,7 +32,7 @@ import (
var _ = framework.KubeDescribe("Downward API", func() {
f := framework.NewDefaultFramework("downward-api")
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{
{
Name: "POD_NAME",
@ -63,7 +63,7 @@ var _ = framework.KubeDescribe("Downward API", 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{
{
Name: "POD_IP",
@ -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() {
podName := "downward-api-" + string(util.NewUUID())
podName := "downward-api-" + string(uuid.NewUUID())
env := []api.EnvVar{
{
Name: "CPU_LIMIT",

View File

@ -28,8 +28,8 @@ import (
"k8s.io/kubernetes/pkg/api"
apiUnversioned "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
"github.com/davecgh/go-spew/spew"
@ -44,7 +44,7 @@ var _ = framework.KubeDescribe("Kubelet", func() {
podClient = f.PodClient()
})
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() {
podClient.CreateSync(&api.Pod{
ObjectMeta: api.ObjectMeta{
@ -77,7 +77,7 @@ var _ = framework.KubeDescribe("Kubelet", 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() {
isReadOnly := true
podClient.CreateSync(&api.Pod{
@ -114,7 +114,7 @@ var _ = framework.KubeDescribe("Kubelet", func() {
Describe("metrics api", func() {
Context("when querying /stats/summary", 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"
podNames, volumes := createSummaryTestPods(f.PodClient(), podNamePrefix, 2, volumeNamePrefix)
By("Returning stats summary")

View File

@ -27,7 +27,7 @@ import (
"k8s.io/kubernetes/pkg/api/errors"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -40,7 +40,7 @@ var _ = framework.KubeDescribe("MirrorPod", func() {
var ns, staticPodName, mirrorPodName string
BeforeEach(func() {
ns = f.Namespace.Name
staticPodName = "static-pod-" + string(util.NewUUID())
staticPodName = "static-pod-" + string(uuid.NewUUID())
mirrorPodName = staticPodName + "-" + framework.TestContext.NodeName
By("create the static pod")

View File

@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/kubelet/images"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
@ -246,7 +246,7 @@ while true; do sleep 1; done
RestartPolicy: api.RestartPolicyNever,
}
if testCase.secret {
secret.Name = "image-pull-secret-" + string(util.NewUUID())
secret.Name = "image-pull-secret-" + string(uuid.NewUUID())
By("create image pull secret")
_, err := f.Client.Secrets(f.Namespace.Name).Create(secret)
Expect(err).NotTo(HaveOccurred())