Add AnyVolumeDataSource feature gate
Allow any custom resource to be the data source of a PVC, if the AnyVolumeDataSource feature gate is enabled. This is an alpha feature.
This commit is contained in:
@@ -904,8 +904,7 @@ func TestAlphaVolumeSnapshotDataSource(t *testing.T) {
|
||||
}
|
||||
failedTestCases := []core.PersistentVolumeClaimSpec{
|
||||
*testVolumeSnapshotDataSourceInSpec("", "VolumeSnapshot", "snapshot.storage.k8s.io"),
|
||||
*testVolumeSnapshotDataSourceInSpec("test_snapshot", "PersistentVolumeClaim", "snapshot.storage.k8s.io"),
|
||||
*testVolumeSnapshotDataSourceInSpec("test_snapshot", "VolumeSnapshot", "storage.k8s.io"),
|
||||
*testVolumeSnapshotDataSourceInSpec("test_snapshot", "", "snapshot.storage.k8s.io"),
|
||||
}
|
||||
|
||||
for _, tc := range successTestCases {
|
||||
@@ -14864,13 +14863,17 @@ func TestAlphaVolumePVCDataSource(t *testing.T) {
|
||||
expectedFail: true,
|
||||
},
|
||||
{
|
||||
testName: "test specifying pvc with snapshot api group should fail",
|
||||
claimSpec: *testDataSourceInSpec("test_snapshot", "PersistentVolumeClaim", "snapshot.storage.k8s.io"),
|
||||
testName: "test missing kind in snapshot datasource should fail",
|
||||
claimSpec: *testDataSourceInSpec("test_snapshot", "", "snapshot.storage.k8s.io"),
|
||||
expectedFail: true,
|
||||
},
|
||||
{
|
||||
testName: "test invalid group name in snapshot datasource should fail",
|
||||
claimSpec: *testDataSourceInSpec("test_snapshot", "VolumeSnapshot", "storage.k8s.io"),
|
||||
testName: "test create from valid generic custom resource source",
|
||||
claimSpec: *testDataSourceInSpec("test_generic", "Generic", "generic.storage.k8s.io"),
|
||||
},
|
||||
{
|
||||
testName: "test invalid datasource should fail",
|
||||
claimSpec: *testDataSourceInSpec("test_pod", "Pod", ""),
|
||||
expectedFail: true,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user