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

UPSTREAM: <carry>: Skip in-tree topology tests win Azure Disk migrated to CSI

Skip test that depend on in-tree Azure Disk volume plugin that (wrongly)
uses failure domains for value of "topology.kubernetes.io/zone" label in
Azure regions that don't have availability zones.

Our e2e tests blindly use that label and expect that a volume provisioned
in such a "zone" can be used only by nodes in that "zone" (= topology
domain). This is false, Azure Disk CSI driver can use such a volume in any
zone and therefore the test may randomly fail.

See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2066865

openshift-rebase(v1.24):source=7871e95298a
  • Loading branch information
bertinatto authored and soltysh committed Sep 20, 2022
1 parent aff4434 commit e4d66c1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openshift-hack/e2e/annotate/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ var (
},
"[Skipped:azure]": {
"Networking should provide Internet connection for containers", // Azure does not allow ICMP traffic to internet.
// Azure CSI migration changed how we treat regions without zones.
// See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2066865
`\[sig-storage\] In-tree Volumes \[Driver: azure-disk\] \[Testpattern: Dynamic PV \(immediate binding\)\] topology should provision a volume and schedule a pod with AllowedTopologies`,
`\[sig-storage\] In-tree Volumes \[Driver: azure-disk\] \[Testpattern: Dynamic PV \(delayed binding\)\] topology should provision a volume and schedule a pod with AllowedTopologies`,
},
"[Skipped:gce]": {
// Requires creation of a different compute instance in a different zone and is not compatible with volumeBindingMode of WaitForFirstConsumer which we use in 4.x
Expand Down
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 e4d66c1

Please sign in to comment.