diff --git a/test/e2e/framework/test_context.go b/test/e2e/framework/test_context.go index 70eab59550e..b41ba34ed9c 100644 --- a/test/e2e/framework/test_context.go +++ b/test/e2e/framework/test_context.go @@ -142,8 +142,6 @@ type TestContextType struct { FeatureGates map[string]bool // Node e2e specific test context NodeTestContextType - // Storage e2e specific test context - StorageTestContextType // Monitoring solution that is used in current cluster. ClusterMonitoringMode string // Separate Prometheus monitoring deployed in cluster @@ -185,14 +183,6 @@ type NodeTestContextType struct { SystemSpecName string } -// StorageConfig contains the shared settings for storage 2e2 tests. -type StorageTestContextType struct { - // CSIImageVersion overrides the builtin stable version numbers if set. - CSIImageVersion string - // CSIImageRegistry defines the image registry hosting the CSI container images. - CSIImageRegistry string -} - type CloudConfig struct { ApiEndpoint string ProjectID string @@ -326,16 +316,10 @@ func RegisterNodeFlags() { flag.StringVar(&TestContext.SystemSpecName, "system-spec-name", "", "The name of the system spec (e.g., gke) that's used in the node e2e test. The system specs are in test/e2e_node/system/specs/. This is used by the test framework to determine which tests to run for validating the system requirements.") } -func RegisterStorageFlags() { - flag.StringVar(&TestContext.CSIImageVersion, "csiImageVersion", "", "overrides the default tag used for hostpathplugin/csi-attacher/csi-provisioner/driver-registrar images") - flag.StringVar(&TestContext.CSIImageRegistry, "csiImageRegistry", "quay.io/k8scsi", "overrides the default repository used for hostpathplugin/csi-attacher/csi-provisioner/driver-registrar images") -} - // HandleFlags sets up all flags and parses the command line. func HandleFlags() { RegisterCommonFlags() RegisterClusterFlags() - RegisterStorageFlags() flag.Parse() } diff --git a/test/e2e/storage/csi_objects.go b/test/e2e/storage/csi_objects.go index dbb0eb30b92..8e9fb4eb12b 100644 --- a/test/e2e/storage/csi_objects.go +++ b/test/e2e/storage/csi_objects.go @@ -20,6 +20,7 @@ limitations under the License. package storage import ( + "flag" "fmt" "io/ioutil" "os" @@ -46,18 +47,22 @@ import ( csicrd "k8s.io/csi-api/pkg/crd" ) -var csiImageVersions = map[string]string{ - "hostpathplugin": "v0.4.0", - "csi-attacher": "v0.4.0", - "csi-provisioner": "v0.4.0", - "driver-registrar": "v0.4.0", -} +var ( + csiImageVersion = flag.String("storage.csi.image.version", "", "overrides the default tag used for hostpathplugin/csi-attacher/csi-provisioner/driver-registrar images") + csiImageRegistry = flag.String("storage.csi.image.registry", "quay.io/k8scsi", "overrides the default repository used for hostpathplugin/csi-attacher/csi-provisioner/driver-registrar images") + csiImageVersions = map[string]string{ + "hostpathplugin": "v0.4.0", + "csi-attacher": "v0.4.0", + "csi-provisioner": "v0.4.0", + "driver-registrar": "v0.4.0", + } +) func csiContainerImage(image string) string { var fullName string - fullName += framework.TestContext.CSIImageRegistry + "/" + image + ":" - if framework.TestContext.CSIImageVersion != "" { - fullName += framework.TestContext.CSIImageVersion + fullName += *csiImageRegistry + "/" + image + ":" + if *csiImageVersion != "" { + fullName += *csiImageVersion } else { fullName += csiImageVersions[image] }