Skip to content

Commit

Permalink
Merge pull request kubernetes#118388 from andyzhangx/revert-118236-re…
Browse files Browse the repository at this point in the history
…move-azurefile

Reinstate the azureFile in-tree storage plugin (revert removal)
  • Loading branch information
k8s-ci-robot committed Jun 2, 2023
2 parents decf1e1 + 1ce285a commit 08579e8
Show file tree
Hide file tree
Showing 11 changed files with 1,386 additions and 3 deletions.
22 changes: 21 additions & 1 deletion cmd/kube-controller-manager/app/plugins_providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"k8s.io/klog/v2"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/azure_file"
"k8s.io/kubernetes/pkg/volume/csimigration"
"k8s.io/kubernetes/pkg/volume/gcepd"
"k8s.io/kubernetes/pkg/volume/portworx"
Expand Down Expand Up @@ -80,5 +81,24 @@ func appendExpandableLegacyProviderVolumes(logger klog.Logger, allPlugins []volu
}

func appendLegacyProviderVolumes(logger klog.Logger, allPlugins []volume.VolumePlugin, featureGate featuregate.FeatureGate) ([]volume.VolumePlugin, error) {
return appendAttachableLegacyProviderVolumes(logger, allPlugins, featureGate)
var err error
// First append attachable volumes
allPlugins, err = appendAttachableLegacyProviderVolumes(logger, allPlugins, featureGate)
if err != nil {
return allPlugins, err
}

// Then append non-attachable volumes
pluginName := plugins.AzureFileInTreePluginName
pluginInfo := pluginInfo{
pluginMigrationFeature: features.CSIMigrationAzureFile,
pluginUnregisterFeature: features.InTreePluginAzureFileUnregister,
pluginProbeFunction: azure_file.ProbeVolumePlugins,
}
allPlugins, err = appendPluginBasedOnFeatureFlags(logger, allPlugins, pluginName, featureGate, pluginInfo)
if err != nil {
return allPlugins, err
}

return allPlugins, nil
}
2 changes: 2 additions & 0 deletions cmd/kubelet/app/plugins_providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"k8s.io/klog/v2"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/azure_file"
"k8s.io/kubernetes/pkg/volume/csimigration"
"k8s.io/kubernetes/pkg/volume/gcepd"
"k8s.io/kubernetes/pkg/volume/portworx"
Expand Down Expand Up @@ -66,6 +67,7 @@ type pluginInfo struct {
func appendLegacyProviderVolumes(allPlugins []volume.VolumePlugin, featureGate featuregate.FeatureGate) ([]volume.VolumePlugin, error) {
pluginMigrationStatus := make(map[string]pluginInfo)
pluginMigrationStatus[plugins.GCEPDInTreePluginName] = pluginInfo{pluginMigrationFeature: features.CSIMigrationGCE, pluginUnregisterFeature: features.InTreePluginGCEUnregister, pluginProbeFunction: gcepd.ProbeVolumePlugins}
pluginMigrationStatus[plugins.AzureFileInTreePluginName] = pluginInfo{pluginMigrationFeature: features.CSIMigrationAzureFile, pluginUnregisterFeature: features.InTreePluginAzureFileUnregister, pluginProbeFunction: azure_file.ProbeVolumePlugins}
pluginMigrationStatus[plugins.VSphereInTreePluginName] = pluginInfo{pluginMigrationFeature: features.CSIMigrationvSphere, pluginUnregisterFeature: features.InTreePluginvSphereUnregister, pluginProbeFunction: vsphere_volume.ProbeVolumePlugins}
pluginMigrationStatus[plugins.PortworxVolumePluginName] = pluginInfo{pluginMigrationFeature: features.CSIMigrationPortworx, pluginUnregisterFeature: features.InTreePluginPortworxUnregister, pluginProbeFunction: portworx.ProbeVolumePlugins}
pluginMigrationStatus[plugins.RBDVolumePluginName] = pluginInfo{pluginMigrationFeature: features.CSIMigrationRBD, pluginUnregisterFeature: features.InTreePluginRBDUnregister, pluginProbeFunction: rbd.ProbeVolumePlugins}
Expand Down
10 changes: 10 additions & 0 deletions pkg/features/kube_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ const (
// Allow the usage of options to fine-tune the cpumanager policies.
CPUManagerPolicyOptions featuregate.Feature = "CPUManagerPolicyOptions"

// owner: @andyzhangx
// alpha: v1.15
// beta: v1.21
// GA: v1.26
//
// Enables the Azure File in-tree driver to Azure File Driver migration feature.
CSIMigrationAzureFile featuregate.Feature = "CSIMigrationAzureFile"

// owner: @davidz627
// alpha: v1.14
// beta: v1.17
Expand Down Expand Up @@ -870,6 +878,8 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS

CPUManagerPolicyOptions: {Default: true, PreRelease: featuregate.Beta},

CSIMigrationAzureFile: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.28

CSIMigrationGCE: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.27

CSIMigrationPortworx: {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires Portworx CSI driver)
Expand Down
18 changes: 18 additions & 0 deletions pkg/volume/azure_file/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See the OWNERS docs at https://go.k8s.io/owners

approvers:
- andyzhangx
- feiskyer
- khenidak
reviewers:
- andyzhangx
- feiskyer
- jsafrane
- jingxu97
- khenidak
- msau42
- saad-ali
emeritus_approvers:
- karataliu
- rootfs
- brendandburns

0 comments on commit 08579e8

Please sign in to comment.