Skip to content

Commit

Permalink
UPSTREAM: <carry>: add CSI migration feature gates for GCE PD and Azu…
Browse files Browse the repository at this point in the history
…re Disk

This commit is the next natural step for commit 2d9a8f9. It
introduces custom feature gates to enable the CSI migration in
GCE PD and Azure Disk plugins.

See openshift/enhancements#549 for details.

Stop <carrying> the patch when CSI migration becomes GA (i.e.
features.CSIMigrationAzureDisk / features.CSIMigrationGCE are GA).
  • Loading branch information
bertinatto committed Jun 29, 2021
1 parent b2e08e3 commit d37e84c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
22 changes: 18 additions & 4 deletions pkg/features/patch_kube_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,35 @@ import (

var (
// owner: @jsafrane
// alpha: v1.21
// beta: v1.21
//
// Enables the AWS EBS CSI migration for the Attach/Detach controller (ADC) only.
ADCCSIMigrationAWS featuregate.Feature = "ADC_CSIMigrationAWS"

// owner: @fbertina
// beta: v1.22
//
// Enables the Azure Disk CSI migration for the Attach/Detach controller (ADC) only.
ADCCSIMigrationAzureDisk featuregate.Feature = "ADC_CSIMigrationAzureDisk"

// owner: @jsafrane
// alpha: v1.21
// beta: v1.21
//
// Enables the Cinder CSI migration for the Attach/Detach controller (ADC) only.
ADCCSIMigrationCinder featuregate.Feature = "ADC_CSIMigrationCinder"

// owner: @fbertina
// beta: v1.22
//
// Enables the GCE CSI migration for the Attach/Detach controller (ADC) only.
ADCCSIMigrationGCEPD featuregate.Feature = "ADC_CSIMigrationGCEPD"
)

var ocpDefaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
ADCCSIMigrationAWS: {Default: true, PreRelease: featuregate.Beta},
ADCCSIMigrationCinder: {Default: true, PreRelease: featuregate.Beta},
ADCCSIMigrationAWS: {Default: true, PreRelease: featuregate.Beta},
ADCCSIMigrationAzureDisk: {Default: true, PreRelease: featuregate.Beta},
ADCCSIMigrationCinder: {Default: true, PreRelease: featuregate.Beta},
ADCCSIMigrationGCEPD: {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 @@ -26,8 +26,12 @@ func (pm PluginManager) adcIsMigrationEnabledForPlugin(pluginName string) bool {
switch pluginName {
case csilibplugins.AWSEBSInTreePluginName:
return pm.featureGate.Enabled(features.ADCCSIMigrationAWS)
case csilibplugins.AzureDiskInTreePluginName:
return pm.featureGate.Enabled(features.ADCCSIMigrationAzureDisk)
case csilibplugins.CinderInTreePluginName:
return pm.featureGate.Enabled(features.ADCCSIMigrationCinder)
case csilibplugins.GCEPDInTreePluginName:
return pm.featureGate.Enabled(features.ADCCSIMigrationGCEPD)
default:
return pm.isMigrationEnabledForPlugin(pluginName)
}
Expand Down

0 comments on commit d37e84c

Please sign in to comment.