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:
Ben Swartzlander
2020-03-04 17:25:48 -05:00
parent e865c0b219
commit e8b09d3644
11 changed files with 155 additions and 36 deletions

View File

@@ -47,6 +47,10 @@ func dataSourceInUse(oldPVCSpec *core.PersistentVolumeClaimSpec) bool {
func dataSourceIsEnabled(pvcSpec *core.PersistentVolumeClaimSpec) bool {
if pvcSpec.DataSource != nil {
if utilfeature.DefaultFeatureGate.Enabled(features.AnyVolumeDataSource) {
return true
}
apiGroup := ""
if pvcSpec.DataSource.APIGroup != nil {
apiGroup = *pvcSpec.DataSource.APIGroup