Merge pull request #70769 from mkimuram/issue/70760

Fix test driver's unique name consistent
pull/58/head
k8s-ci-robot 2018-11-07 19:10:55 -08:00 committed by GitHub
commit ac217310bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View File

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

View File

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

View File

@ -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",
// }