mirror of https://github.com/k3s-io/k3s
Merge pull request #70769 from mkimuram/issue/70760
Fix test driver's unique name consistentpull/58/head
commit
ac217310bf
|
@ -192,7 +192,7 @@ var _ = utils.SIGDescribe("CSI Volumes", func() {
|
|||
test := t
|
||||
It(test.name, func() {
|
||||
if test.driverExists {
|
||||
csiDriver := createCSIDriver(csics, "csi-hostpath-"+f.UniqueName, test.driverAttachable)
|
||||
csiDriver := createCSIDriver(csics, drivers.GetUniqueDriverName(driver), test.driverAttachable)
|
||||
if csiDriver != nil {
|
||||
defer csics.CsiV1alpha1().CSIDrivers().Delete(csiDriver.Name, nil)
|
||||
}
|
||||
|
|
|
@ -176,3 +176,8 @@ func getStorageClass(
|
|||
VolumeBindingMode: bindingMode,
|
||||
}
|
||||
}
|
||||
|
||||
// GetUniqueDriverName returns unique driver name that can be used parallelly in tests
|
||||
func GetUniqueDriverName(driver TestDriver) string {
|
||||
return fmt.Sprintf("%s-%s", driver.GetDriverInfo().Name, driver.GetDriverInfo().Framework.UniqueName)
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ func (h *hostpathCSIDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern
|
|||
}
|
||||
|
||||
func (h *hostpathCSIDriver) GetDynamicProvisionStorageClass(fsType string) *storagev1.StorageClass {
|
||||
provisioner := h.driverInfo.Name + h.driverInfo.Framework.UniqueName
|
||||
provisioner := GetUniqueDriverName(h)
|
||||
parameters := map[string]string{}
|
||||
ns := h.driverInfo.Framework.Namespace.Name
|
||||
suffix := fmt.Sprintf("%s-sc", provisioner)
|
||||
|
@ -105,7 +105,7 @@ func (h *hostpathCSIDriver) CreateDriver() {
|
|||
// settings are ignored for this test. We could patch the image definitions.
|
||||
o := utils.PatchCSIOptions{
|
||||
OldDriverName: h.driverInfo.Name,
|
||||
NewDriverName: h.driverInfo.Name + h.driverInfo.Framework.UniqueName,
|
||||
NewDriverName: GetUniqueDriverName(h),
|
||||
DriverContainerName: "hostpath",
|
||||
ProvisionerContainerName: "csi-provisioner",
|
||||
NodeName: h.driverInfo.Config.ServerNodeName,
|
||||
|
@ -199,8 +199,8 @@ func (g *gcePDCSIDriver) CreateDriver() {
|
|||
//
|
||||
// These are the options which would have to be used:
|
||||
// o := utils.PatchCSIOptions{
|
||||
// OldDriverName: "com.google.csi.gcepd",
|
||||
// NewDriverName: "com.google.csi.gcepd-" + g.f.UniqueName,
|
||||
// OldDriverName: g.driverInfo.Name,
|
||||
// NewDriverName: GetUniqueDriverName(g),
|
||||
// DriverContainerName: "gce-driver",
|
||||
// ProvisionerContainerName: "csi-external-provisioner",
|
||||
// }
|
||||
|
|
Loading…
Reference in New Issue