diff --git a/test/e2e/storage/external/external.go b/test/e2e/storage/external/external.go index 60bbeae8968..67853d638ff 100644 --- a/test/e2e/storage/external/external.go +++ b/test/e2e/storage/external/external.go @@ -152,6 +152,12 @@ type driverDefinition struct { // use topology to ensure that pods land on the right node(s). ClientNodeName string + // NodeSelectors is used to specify nodeSelector information for pod deployment + // during the tests. This is beneficial when needing to control placement + // for specialized environments. Most drivers should not need this and + // instead can use topolgy to ensure that pods land on the right node(s). + NodeSelectors map[string]string + // Timeouts contains the custom timeouts used during the test execution. // The values specified here will override the default values specified in // the framework.TimeoutContext struct. @@ -493,5 +499,10 @@ func (d *driverDefinition) PrepareTest(ctx context.Context, f *framework.Framewo e2econfig.ClientNodeSelection.Selector = map[string]string{"kubernetes.io/os": "linux"} } + // Add all provided nodeSelector settings + for key, value := range d.NodeSelectors { + e2econfig.ClientNodeSelection.Selector[key] = value + } + return e2econfig }