diff --git a/test/e2e/storage/drivers/csi.go b/test/e2e/storage/drivers/csi.go index aba77e5da79..949965ccdd1 100644 --- a/test/e2e/storage/drivers/csi.go +++ b/test/e2e/storage/drivers/csi.go @@ -40,6 +40,7 @@ import ( "encoding/json" "errors" "fmt" + "os" "strconv" "strings" "sync" @@ -159,7 +160,6 @@ func InitHostPathCSIDriver() storageframework.TestDriver { storageframework.CapReadWriteOncePod: true, storageframework.CapMultiplePVsSameID: true, storageframework.CapFSResizeFromSourceNotSupported: true, - storageframework.CapVolumeGroupSnapshot: true, // There are extensive tests that NodeStage / NodePublish are called with -o context in csimock/csi_selinux_mount.go, // but the csi-driver-hostpath can't physically make -o context to appear in the mount table that the CapSELinuxMount tests expect. storageframework.CapSELinuxMount: false, @@ -170,6 +170,10 @@ func InitHostPathCSIDriver() storageframework.TestDriver { // added when patching the deployment. storageframework.CapVolumeLimits: true, } + // TODO: It can be removed after the VolumeGroupSnapshot feature is default enabled + if os.Getenv("CSI_PROW_ENABLE_GROUP_SNAPSHOT") == "true" { + capabilities[storageframework.CapVolumeGroupSnapshot] = true + } return initHostPathCSIDriver("csi-hostpath", capabilities, // Volume attributes don't matter, but we have to provide at least one map. @@ -293,6 +297,15 @@ func (h *hostpathCSIDriver) PrepareTest(ctx context.Context, f *framework.Framew DriverContainerArguments: []string{"--feature-gates=VolumeAttributesClass=true"}, }) + // VGS E2E FeatureGate patches + // TODO: These can be removed after the VolumeGroupSnapshot feature is default enabled + if os.Getenv("CSI_PROW_ENABLE_GROUP_SNAPSHOT") == "true" { + patches = append(patches, utils.PatchCSIOptions{ + DriverContainerName: "csi-snapshotter", + DriverContainerArguments: []string{"--feature-gates=CSIVolumeGroupSnapshot=true"}, + }) + } + err = utils.CreateFromManifests(ctx, config.Framework, driverNamespace, func(item interface{}) error { for _, o := range patches { if err := utils.PatchCSIDeployment(config.Framework, o, item); err != nil {