Merge pull request #72666 from rajathagasthya/pvc-72651

Move VolumeSnapshotDataSource feature gate check from validation
This commit is contained in:
Kubernetes Prow Robot
2019-01-08 19:22:30 -08:00
committed by GitHub
4 changed files with 107 additions and 12 deletions

View File

@@ -749,8 +749,6 @@ func TestAlphaVolumeSnapshotDataSource(t *testing.T) {
*testVolumeSnapshotDataSourceInSpec("test_snapshot", "VolumeSnapshot", "storage.k8s.io"),
}
// Enable alpha feature VolumeSnapshotDataSource
defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.VolumeSnapshotDataSource, true)()
for _, tc := range successTestCases {
if errs := ValidatePersistentVolumeClaimSpec(&tc, field.NewPath("spec")); len(errs) != 0 {
t.Errorf("expected success: %v", errs)
@@ -761,13 +759,6 @@ func TestAlphaVolumeSnapshotDataSource(t *testing.T) {
t.Errorf("expected failure: %v", errs)
}
}
// Disable alpha feature VolumeSnapshotDataSource
defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.VolumeSnapshotDataSource, false)()
for _, tc := range successTestCases {
if errs := ValidatePersistentVolumeClaimSpec(&tc, field.NewPath("spec")); len(errs) == 0 {
t.Errorf("expected failure: %v", errs)
}
}
}
func testVolumeClaimStorageClassInAnnotationAndSpec(name, namespace, scNameInAnn, scName string, spec core.PersistentVolumeClaimSpec) *core.PersistentVolumeClaim {