mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-12 12:48:51 +00:00
e2e/storage: refactor test config
Exposing framework.VolumeTestConfig as part of the testsuite package API was confusing because it was unclear which of the values in it really have an effect. How it was set also was a bit awkward: a test driver had a copy that had to be overwritten at test runtime and then might have been updated and/or overwritten again by the driver. Now testsuites has its own test config structure. It contains the values that might have to be set dynamically at runtime. Instead of overwriting a copy of that struct inside the test driver, the test driver takes some common defaults (specifically, the framework pointer and the prefix) when it gets initialized and then manages its own copy. For example, the hostpath driver has to lock the pods to a single node. framework.VolumeTestConfig is still used internally and test drivers can decide to run tests with a fully populated instance if needed (for example, after setting up an NFS server).
This commit is contained in:
@@ -86,7 +86,7 @@ func createProvisioningTestInput(driver TestDriver, pattern testpatterns.TestPat
|
||||
ClaimSize: resource.claimSize,
|
||||
ExpectedSize: resource.claimSize,
|
||||
},
|
||||
cs: driver.GetDriverInfo().Framework.ClientSet,
|
||||
cs: driver.GetDriverInfo().Config.Framework.ClientSet,
|
||||
pvc: resource.pvc,
|
||||
sc: resource.sc,
|
||||
dInfo: driver.GetDriverInfo(),
|
||||
@@ -151,7 +151,7 @@ func (p *provisioningTestResource) setupResource(driver TestDriver, pattern test
|
||||
}
|
||||
p.driver = driver
|
||||
p.claimSize = dDriver.GetClaimSize()
|
||||
p.pvc = getClaim(p.claimSize, driver.GetDriverInfo().Framework.Namespace.Name)
|
||||
p.pvc = getClaim(p.claimSize, driver.GetDriverInfo().Config.Framework.Namespace.Name)
|
||||
p.pvc.Spec.StorageClassName = &p.sc.Name
|
||||
framework.Logf("In creating storage class object and pvc object for driver - sc: %v, pvc: %v", p.sc, p.pvc)
|
||||
}
|
||||
|
Reference in New Issue
Block a user