mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #113046 from jsafrane/add-multiplepv-cap
Add capability for tests with multiple PVs with the same VolumeHandle
This commit is contained in:
commit
6be327c053
@ -149,6 +149,7 @@ func InitHostPathCSIDriver() storageframework.TestDriver {
|
|||||||
storageframework.CapOnlineExpansion: true,
|
storageframework.CapOnlineExpansion: true,
|
||||||
storageframework.CapSingleNodeVolume: true,
|
storageframework.CapSingleNodeVolume: true,
|
||||||
storageframework.CapReadWriteOncePod: true,
|
storageframework.CapReadWriteOncePod: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
|
|
||||||
// This is needed for the
|
// This is needed for the
|
||||||
// testsuites/volumelimits.go `should support volume limits`
|
// testsuites/volumelimits.go `should support volume limits`
|
||||||
@ -487,10 +488,11 @@ func InitMockCSIDriver(driverOpts CSIMockDriverOpts) MockCSITestDriver {
|
|||||||
"", // Default fsType
|
"", // Default fsType
|
||||||
),
|
),
|
||||||
Capabilities: map[storageframework.Capability]bool{
|
Capabilities: map[storageframework.Capability]bool{
|
||||||
storageframework.CapPersistence: false,
|
storageframework.CapPersistence: false,
|
||||||
storageframework.CapFsGroup: false,
|
storageframework.CapFsGroup: false,
|
||||||
storageframework.CapExec: false,
|
storageframework.CapExec: false,
|
||||||
storageframework.CapVolumeLimits: true,
|
storageframework.CapVolumeLimits: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
manifests: driverManifests,
|
manifests: driverManifests,
|
||||||
@ -807,6 +809,7 @@ func InitGcePDCSIDriver() storageframework.TestDriver {
|
|||||||
storageframework.CapNodeExpansion: true,
|
storageframework.CapNodeExpansion: true,
|
||||||
storageframework.CapSnapshotDataSource: true,
|
storageframework.CapSnapshotDataSource: true,
|
||||||
storageframework.CapReadWriteOncePod: true,
|
storageframework.CapReadWriteOncePod: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
RequiredAccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce},
|
RequiredAccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce},
|
||||||
TopologyKeys: []string{GCEPDCSIZoneTopologyKey},
|
TopologyKeys: []string{GCEPDCSIZoneTopologyKey},
|
||||||
|
@ -105,10 +105,11 @@ func InitNFSDriver() storageframework.TestDriver {
|
|||||||
SupportedMountOption: sets.NewString("relatime"),
|
SupportedMountOption: sets.NewString("relatime"),
|
||||||
RequiredMountOption: sets.NewString("vers=4.1"),
|
RequiredMountOption: sets.NewString("vers=4.1"),
|
||||||
Capabilities: map[storageframework.Capability]bool{
|
Capabilities: map[storageframework.Capability]bool{
|
||||||
storageframework.CapPersistence: true,
|
storageframework.CapPersistence: true,
|
||||||
storageframework.CapExec: true,
|
storageframework.CapExec: true,
|
||||||
storageframework.CapRWX: true,
|
storageframework.CapRWX: true,
|
||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -249,12 +250,13 @@ func InitISCSIDriver() storageframework.TestDriver {
|
|||||||
),
|
),
|
||||||
TopologyKeys: []string{v1.LabelHostname},
|
TopologyKeys: []string{v1.LabelHostname},
|
||||||
Capabilities: map[storageframework.Capability]bool{
|
Capabilities: map[storageframework.Capability]bool{
|
||||||
storageframework.CapPersistence: true,
|
storageframework.CapPersistence: true,
|
||||||
storageframework.CapFsGroup: true,
|
storageframework.CapFsGroup: true,
|
||||||
storageframework.CapBlock: true,
|
storageframework.CapBlock: true,
|
||||||
storageframework.CapExec: true,
|
storageframework.CapExec: true,
|
||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
storageframework.CapTopology: true,
|
storageframework.CapTopology: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -431,11 +433,12 @@ func InitRbdDriver() storageframework.TestDriver {
|
|||||||
"ext4",
|
"ext4",
|
||||||
),
|
),
|
||||||
Capabilities: map[storageframework.Capability]bool{
|
Capabilities: map[storageframework.Capability]bool{
|
||||||
storageframework.CapPersistence: true,
|
storageframework.CapPersistence: true,
|
||||||
storageframework.CapFsGroup: true,
|
storageframework.CapFsGroup: true,
|
||||||
storageframework.CapBlock: true,
|
storageframework.CapBlock: true,
|
||||||
storageframework.CapExec: true,
|
storageframework.CapExec: true,
|
||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -559,10 +562,11 @@ func InitCephFSDriver() storageframework.TestDriver {
|
|||||||
"", // Default fsType
|
"", // Default fsType
|
||||||
),
|
),
|
||||||
Capabilities: map[storageframework.Capability]bool{
|
Capabilities: map[storageframework.Capability]bool{
|
||||||
storageframework.CapPersistence: true,
|
storageframework.CapPersistence: true,
|
||||||
storageframework.CapExec: true,
|
storageframework.CapExec: true,
|
||||||
storageframework.CapRWX: true,
|
storageframework.CapRWX: true,
|
||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -662,10 +666,11 @@ func InitHostPathDriver() storageframework.TestDriver {
|
|||||||
),
|
),
|
||||||
TopologyKeys: []string{v1.LabelHostname},
|
TopologyKeys: []string{v1.LabelHostname},
|
||||||
Capabilities: map[storageframework.Capability]bool{
|
Capabilities: map[storageframework.Capability]bool{
|
||||||
storageframework.CapPersistence: true,
|
storageframework.CapPersistence: true,
|
||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
storageframework.CapSingleNodeVolume: true,
|
storageframework.CapSingleNodeVolume: true,
|
||||||
storageframework.CapTopology: true,
|
storageframework.CapTopology: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -737,10 +742,11 @@ func InitHostPathSymlinkDriver() storageframework.TestDriver {
|
|||||||
),
|
),
|
||||||
TopologyKeys: []string{v1.LabelHostname},
|
TopologyKeys: []string{v1.LabelHostname},
|
||||||
Capabilities: map[storageframework.Capability]bool{
|
Capabilities: map[storageframework.Capability]bool{
|
||||||
storageframework.CapPersistence: true,
|
storageframework.CapPersistence: true,
|
||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
storageframework.CapSingleNodeVolume: true,
|
storageframework.CapSingleNodeVolume: true,
|
||||||
storageframework.CapTopology: true,
|
storageframework.CapTopology: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -966,8 +972,9 @@ func InitGcePdDriver() storageframework.TestDriver {
|
|||||||
storageframework.CapNodeExpansion: true,
|
storageframework.CapNodeExpansion: true,
|
||||||
// GCE supports volume limits, but the test creates large
|
// GCE supports volume limits, but the test creates large
|
||||||
// number of volumes and times out test suites.
|
// number of volumes and times out test suites.
|
||||||
storageframework.CapVolumeLimits: false,
|
storageframework.CapVolumeLimits: false,
|
||||||
storageframework.CapTopology: true,
|
storageframework.CapTopology: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -998,8 +1005,9 @@ func InitWindowsGcePdDriver() storageframework.TestDriver {
|
|||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
// GCE supports volume limits, but the test creates large
|
// GCE supports volume limits, but the test creates large
|
||||||
// number of volumes and times out test suites.
|
// number of volumes and times out test suites.
|
||||||
storageframework.CapVolumeLimits: false,
|
storageframework.CapVolumeLimits: false,
|
||||||
storageframework.CapTopology: true,
|
storageframework.CapTopology: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -1136,12 +1144,13 @@ func InitVSphereDriver() storageframework.TestDriver {
|
|||||||
),
|
),
|
||||||
TopologyKeys: []string{v1.LabelFailureDomainBetaZone},
|
TopologyKeys: []string{v1.LabelFailureDomainBetaZone},
|
||||||
Capabilities: map[storageframework.Capability]bool{
|
Capabilities: map[storageframework.Capability]bool{
|
||||||
storageframework.CapPersistence: true,
|
storageframework.CapPersistence: true,
|
||||||
storageframework.CapFsGroup: true,
|
storageframework.CapFsGroup: true,
|
||||||
storageframework.CapExec: true,
|
storageframework.CapExec: true,
|
||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
storageframework.CapTopology: true,
|
storageframework.CapTopology: true,
|
||||||
storageframework.CapBlock: true,
|
storageframework.CapBlock: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -1282,8 +1291,9 @@ func InitAzureDiskDriver() storageframework.TestDriver {
|
|||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
// Azure supports volume limits, but the test creates large
|
// Azure supports volume limits, but the test creates large
|
||||||
// number of volumes and times out test suites.
|
// number of volumes and times out test suites.
|
||||||
storageframework.CapVolumeLimits: false,
|
storageframework.CapVolumeLimits: false,
|
||||||
storageframework.CapTopology: true,
|
storageframework.CapTopology: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -1431,8 +1441,9 @@ func InitAwsDriver() storageframework.TestDriver {
|
|||||||
storageframework.CapOnlineExpansion: true,
|
storageframework.CapOnlineExpansion: true,
|
||||||
// AWS supports volume limits, but the test creates large
|
// AWS supports volume limits, but the test creates large
|
||||||
// number of volumes and times out test suites.
|
// number of volumes and times out test suites.
|
||||||
storageframework.CapVolumeLimits: false,
|
storageframework.CapVolumeLimits: false,
|
||||||
storageframework.CapTopology: true,
|
storageframework.CapTopology: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -1551,21 +1562,23 @@ type localVolume struct {
|
|||||||
var (
|
var (
|
||||||
// capabilities
|
// capabilities
|
||||||
defaultLocalVolumeCapabilities = map[storageframework.Capability]bool{
|
defaultLocalVolumeCapabilities = map[storageframework.Capability]bool{
|
||||||
storageframework.CapPersistence: true,
|
storageframework.CapPersistence: true,
|
||||||
storageframework.CapFsGroup: true,
|
storageframework.CapFsGroup: true,
|
||||||
storageframework.CapBlock: false,
|
storageframework.CapBlock: false,
|
||||||
storageframework.CapExec: true,
|
storageframework.CapExec: true,
|
||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
storageframework.CapSingleNodeVolume: true,
|
storageframework.CapSingleNodeVolume: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
}
|
}
|
||||||
localVolumeCapabitilies = map[utils.LocalVolumeType]map[storageframework.Capability]bool{
|
localVolumeCapabitilies = map[utils.LocalVolumeType]map[storageframework.Capability]bool{
|
||||||
utils.LocalVolumeBlock: {
|
utils.LocalVolumeBlock: {
|
||||||
storageframework.CapPersistence: true,
|
storageframework.CapPersistence: true,
|
||||||
storageframework.CapFsGroup: true,
|
storageframework.CapFsGroup: true,
|
||||||
storageframework.CapBlock: true,
|
storageframework.CapBlock: true,
|
||||||
storageframework.CapExec: true,
|
storageframework.CapExec: true,
|
||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
storageframework.CapSingleNodeVolume: true,
|
storageframework.CapSingleNodeVolume: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
// fstype
|
// fstype
|
||||||
@ -1796,6 +1809,7 @@ func InitAzureFileDriver() storageframework.TestDriver {
|
|||||||
storageframework.CapMultiPODs: true,
|
storageframework.CapMultiPODs: true,
|
||||||
storageframework.CapControllerExpansion: true,
|
storageframework.CapControllerExpansion: true,
|
||||||
storageframework.CapNodeExpansion: true,
|
storageframework.CapNodeExpansion: true,
|
||||||
|
storageframework.CapMultiplePVsSameID: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -190,6 +190,16 @@ const (
|
|||||||
// - csi-attacher:v3.3.0+
|
// - csi-attacher:v3.3.0+
|
||||||
// - csi-resizer:v1.3.0+
|
// - csi-resizer:v1.3.0+
|
||||||
CapReadWriteOncePod Capability = "readWriteOncePod"
|
CapReadWriteOncePod Capability = "readWriteOncePod"
|
||||||
|
|
||||||
|
// The driver can handle two PersistentVolumes with the same VolumeHandle (= volume_id in CSI spec).
|
||||||
|
// This capability is highly recommended for volumes that support ReadWriteMany access mode,
|
||||||
|
// because creating multiple PVs for the same VolumeHandle is frequently used to share a single
|
||||||
|
// volume among multiple namespaces.
|
||||||
|
// Note that this capability needs to be disabled only for CSI drivers that break CSI boundary and
|
||||||
|
// inspect Kubernetes PersistentVolume objects. A CSI driver that implements only CSI and does not
|
||||||
|
// talk to Kubernetes API server in any way should keep this capability enabled, because
|
||||||
|
// they will see the same NodeStage / NodePublish requests as if only one PV existed.
|
||||||
|
CapMultiplePVsSameID Capability = "multiplePVsSameID"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DriverInfo represents static information about a TestDriver.
|
// DriverInfo represents static information about a TestDriver.
|
||||||
|
@ -530,6 +530,10 @@ func (p *provisioningTestSuite) DefineTests(driver storageframework.TestDriver,
|
|||||||
e2eskipper.Skipf("skipping multiple PV mount test for block mode")
|
e2eskipper.Skipf("skipping multiple PV mount test for block mode")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !dInfo.Capabilities[storageframework.CapMultiplePVsSameID] {
|
||||||
|
e2eskipper.Skipf("this driver does not support multiple PVs with the same volumeHandle")
|
||||||
|
}
|
||||||
|
|
||||||
init()
|
init()
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user