mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #9335 from swagiaal/e2e-test-prefix
Add a prefix option to e2e for use with resources
This commit is contained in:
commit
cf4b4a313b
@ -105,5 +105,6 @@ export PATH=$(dirname "${e2e_test}"):"${PATH}"
|
||||
--repo-root="${KUBE_VERSION_ROOT}" \
|
||||
--node-instance-group="${NODE_INSTANCE_GROUP:-}" \
|
||||
--num-nodes="${NUM_MINIONS:-}" \
|
||||
--prefix="${KUBE_GCE_INSTANCE_PREFIX:-e2e}" \
|
||||
${E2E_REPORT_DIR+"--report-dir=${E2E_REPORT_DIR}"} \
|
||||
"${@:-}"
|
||||
|
@ -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.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.prefix, "prefix", "e2e", "A prefix to be added to cloud resources created during testing.")
|
||||
|
||||
// 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")
|
||||
|
@ -189,7 +189,7 @@ var _ = Describe("Pod Disks", func() {
|
||||
|
||||
func createPD() (string, error) {
|
||||
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
|
||||
// TODO: make this hit the compute API directly instread of shelling out to gcloud.
|
||||
|
@ -106,6 +106,7 @@ type TestContextType struct {
|
||||
CloudConfig CloudConfig
|
||||
KubectlPath string
|
||||
OutputDir string
|
||||
prefix string
|
||||
}
|
||||
|
||||
var testContext TestContextType
|
||||
|
Loading…
Reference in New Issue
Block a user