Refactor uuid into its own pkg
This commit is contained in:
@@ -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{
|
||||
{
|
||||
|
||||
@@ -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{},
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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{},
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user