Merge pull request #134214 from Phaow/dev

Refine: VolumeGroupSnapshot tests
This commit is contained in:
Kubernetes Prow Robot
2025-10-16 08:00:45 -07:00
committed by GitHub

View File

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