Merge pull request #9335 from swagiaal/e2e-test-prefix

Add a prefix option to e2e for use with resources
This commit is contained in:
krousey 2015-06-09 11:50:02 -07:00
commit cf4b4a313b
4 changed files with 4 additions and 1 deletions

View File

@ -105,5 +105,6 @@ export PATH=$(dirname "${e2e_test}"):"${PATH}"
--repo-root="${KUBE_VERSION_ROOT}" \ --repo-root="${KUBE_VERSION_ROOT}" \
--node-instance-group="${NODE_INSTANCE_GROUP:-}" \ --node-instance-group="${NODE_INSTANCE_GROUP:-}" \
--num-nodes="${NUM_MINIONS:-}" \ --num-nodes="${NUM_MINIONS:-}" \
--prefix="${KUBE_GCE_INSTANCE_PREFIX:-e2e}" \
${E2E_REPORT_DIR+"--report-dir=${E2E_REPORT_DIR}"} \ ${E2E_REPORT_DIR+"--report-dir=${E2E_REPORT_DIR}"} \
"${@:-}" "${@:-}"

View File

@ -101,6 +101,7 @@ func init() {
flag.StringVar(&testContext.Provider, "provider", "", "The name of the Kubernetes provider (gce, gke, local, vagrant, etc.)") flag.StringVar(&testContext.Provider, "provider", "", "The name of the Kubernetes provider (gce, gke, local, vagrant, etc.)")
flag.StringVar(&testContext.KubectlPath, "kubectl-path", "kubectl", "The kubectl binary to use. For development, you might use 'cluster/kubectl.sh' here.") flag.StringVar(&testContext.KubectlPath, "kubectl-path", "kubectl", "The kubectl binary to use. For development, you might use 'cluster/kubectl.sh' here.")
flag.StringVar(&testContext.OutputDir, "e2e-output-dir", "/tmp", "Output directory for interesting/useful test data, like performance data, benchmarks, and other metrics.") flag.StringVar(&testContext.OutputDir, "e2e-output-dir", "/tmp", "Output directory for interesting/useful test data, like performance data, benchmarks, and other metrics.")
flag.StringVar(&testContext.prefix, "prefix", "e2e", "A prefix to be added to cloud resources created during testing.")
// TODO: Flags per provider? Rename gce-project/gce-zone? // TODO: Flags per provider? Rename gce-project/gce-zone?
flag.StringVar(&cloudConfig.MasterName, "kube-master", "", "Name of the kubernetes master. Only required if provider is gce or gke") flag.StringVar(&cloudConfig.MasterName, "kube-master", "", "Name of the kubernetes master. Only required if provider is gce or gke")

View File

@ -189,7 +189,7 @@ var _ = Describe("Pod Disks", func() {
func createPD() (string, error) { func createPD() (string, error) {
if testContext.Provider == "gce" { if testContext.Provider == "gce" {
pdName := fmt.Sprintf("e2e-%s", string(util.NewUUID())) pdName := fmt.Sprintf("%s-%s", testContext.prefix, string(util.NewUUID()))
zone := testContext.CloudConfig.Zone zone := testContext.CloudConfig.Zone
// TODO: make this hit the compute API directly instread of shelling out to gcloud. // TODO: make this hit the compute API directly instread of shelling out to gcloud.

View File

@ -106,6 +106,7 @@ type TestContextType struct {
CloudConfig CloudConfig CloudConfig CloudConfig
KubectlPath string KubectlPath string
OutputDir string OutputDir string
prefix string
} }
var testContext TestContextType var testContext TestContextType