Add feature gate check for migration at beginning of useCSIPlugin check

pull/564/head
David Zhu 2019-02-26 11:47:20 -08:00
parent 74036c082a
commit b0b6fd035a
1 changed files with 3 additions and 0 deletions

View File

@ -1535,6 +1535,9 @@ func isDeviceOpened(deviceToDetach AttachedVolume, mounter mount.Interface) (boo
// TODO(dyzz): need to also add logic to check CSINodeInfo for Kubelet migration status // TODO(dyzz): need to also add logic to check CSINodeInfo for Kubelet migration status
func useCSIPlugin(vpm *volume.VolumePluginMgr, spec *volume.Spec) bool { func useCSIPlugin(vpm *volume.VolumePluginMgr, spec *volume.Spec) bool {
if !utilfeature.DefaultFeatureGate.Enabled(features.CSIMigration) {
return false
}
if csilib.IsPVMigratable(spec.PersistentVolume) || csilib.IsInlineMigratable(spec.Volume) { if csilib.IsPVMigratable(spec.PersistentVolume) || csilib.IsInlineMigratable(spec.Volume) {
migratable, err := vpm.IsPluginMigratableBySpec(spec) migratable, err := vpm.IsPluginMigratableBySpec(spec)
if err == nil && migratable { if err == nil && migratable {