From 3db91b2bdc9936d7b7facce4e609c36d242432bb Mon Sep 17 00:00:00 2001 From: Christian Huffman Date: Tue, 17 Dec 2019 12:56:02 -0500 Subject: [PATCH] Enabled reading config files for vsphere e2e tests --- test/e2e/framework/test_context.go | 2 +- test/e2e/storage/vsphere/config.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/e2e/framework/test_context.go b/test/e2e/framework/test_context.go index dedd1576111..c9b8a37db4f 100644 --- a/test/e2e/framework/test_context.go +++ b/test/e2e/framework/test_context.go @@ -333,7 +333,7 @@ func RegisterClusterFlags(flags *flag.FlagSet) { flags.StringVar(&cloudConfig.MasterTag, "master-tag", "", "Network tags used on master instances. Valid only for gce, gke") flags.StringVar(&cloudConfig.ClusterTag, "cluster-tag", "", "Tag used to identify resources. Only required if provider is aws.") - flags.StringVar(&cloudConfig.ConfigFile, "cloud-config-file", "", "Cloud config file. Only required if provider is azure.") + flags.StringVar(&cloudConfig.ConfigFile, "cloud-config-file", "", "Cloud config file. Only required if provider is azure or vsphere.") flags.IntVar(&TestContext.MinStartupPods, "minStartupPods", 0, "The number of pods which we need to see in 'Running' state with a 'Ready' condition of true, before we try running tests. This is useful in any cluster which needs some base pod-based services running before it can be used.") flags.DurationVar(&TestContext.SystemPodsStartupTimeout, "system-pods-startup-timeout", 10*time.Minute, "Timeout for waiting for all system pods to be running before starting tests.") flags.DurationVar(&TestContext.NodeSchedulableTimeout, "node-schedulable-timeout", 30*time.Minute, "Timeout for waiting for all nodes to be schedulable.") diff --git a/test/e2e/storage/vsphere/config.go b/test/e2e/storage/vsphere/config.go index 98f3feb0c35..b24bbabf778 100644 --- a/test/e2e/storage/vsphere/config.go +++ b/test/e2e/storage/vsphere/config.go @@ -98,7 +98,10 @@ func GetVSphereInstances() (map[string]*VSphere, error) { func getConfig() (*ConfigFile, error) { if confFileLocation == "" { - return nil, fmt.Errorf("Env variable 'VSPHERE_CONF_FILE' is not set.") + if framework.TestContext.CloudConfig.ConfigFile == "" { + return nil, fmt.Errorf("Env variable 'VSPHERE_CONF_FILE' is not set, and no config-file specified") + } + confFileLocation = framework.TestContext.CloudConfig.ConfigFile } confFile, err := os.Open(confFileLocation) if err != nil {