Added NodeSelectors field to DriverDefinition

This commit is contained in:
vr4manta
2025-07-11 08:23:44 -04:00
parent 64f7af48d7
commit d8676a24cc

View File

@@ -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
}