Skip to content

Commit

Permalink
UPSTREAM: <carry>: add CSI migration feature gates for vSphere and Az…
Browse files Browse the repository at this point in the history
…ure File

This commit is the next natural step for commits 2d9a8f9
and d37e84c. It introduces custom feature gates to enable
the CSI migration in vSphere and Azure File plugins.

See openshift/enhancements#549 for details.

Stop <carrying> the patch when CSI migration becomes GA (i.e.
features.CSIMigrationAzureFile / features.CSIMigrationVSphere
are GA).

openshift-rebase(v1.24):source=2701d71abb4
  • Loading branch information
bertinatto authored and soltysh committed Aug 22, 2022
1 parent 3598b29 commit cf6f444
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/features/patch_kube_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ var (
// Enables the Azure Disk CSI migration for the Attach/Detach controller (ADC) only.
ADCCSIMigrationAzureDisk featuregate.Feature = "ADC_CSIMigrationAzureDisk"

// owner: @fbertina
// beta: v1.23
//
// Enables the Azure File CSI migration for the Attach/Detach controller (ADC) only.
ADCCSIMigrationAzureFile featuregate.Feature = "ADC_CSIMigrationAzureFile"

// owner: @jsafrane
// beta: v1.21
//
Expand All @@ -30,13 +36,21 @@ var (
//
// Enables the GCE CSI migration for the Attach/Detach controller (ADC) only.
ADCCSIMigrationGCEPD featuregate.Feature = "ADC_CSIMigrationGCEPD"

// owner: @fbertina
// beta: v1.23
//
// Enables the vSphere CSI migration for the Attach/Detach controller (ADC) only.
ADCCSIMigrationVSphere featuregate.Feature = "ADC_CSIMigrationVSphere"
)

var ocpDefaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
ADCCSIMigrationAWS: {Default: true, PreRelease: featuregate.Beta},
ADCCSIMigrationAzureDisk: {Default: true, PreRelease: featuregate.Beta},
ADCCSIMigrationAzureFile: {Default: true, PreRelease: featuregate.Beta},
ADCCSIMigrationCinder: {Default: true, PreRelease: featuregate.Beta},
ADCCSIMigrationGCEPD: {Default: true, PreRelease: featuregate.Beta},
ADCCSIMigrationVSphere: {Default: true, PreRelease: featuregate.Beta},
}

func init() {
Expand Down
4 changes: 4 additions & 0 deletions pkg/volume/csimigration/patch_adc_plugin_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ func (pm PluginManager) adcIsMigrationEnabledForPlugin(pluginName string) bool {
return pm.featureGate.Enabled(features.ADCCSIMigrationAWS)
case csilibplugins.AzureDiskInTreePluginName:
return pm.featureGate.Enabled(features.ADCCSIMigrationAzureDisk)
case csilibplugins.AzureFileInTreePluginName:
return pm.featureGate.Enabled(features.ADCCSIMigrationAzureFile)
case csilibplugins.CinderInTreePluginName:
return pm.featureGate.Enabled(features.ADCCSIMigrationCinder)
case csilibplugins.GCEPDInTreePluginName:
return pm.featureGate.Enabled(features.ADCCSIMigrationGCEPD)
case csilibplugins.VSphereInTreePluginName:
return pm.featureGate.Enabled(features.ADCCSIMigrationVSphere)
default:
return pm.isMigrationEnabledForPlugin(pluginName)
}
Expand Down

0 comments on commit cf6f444

Please sign in to comment.