mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #83098 from ddebroy/disable-intree
CSI Migration phase 2: disable probing of in-tree plugins
This commit is contained in:
		@@ -159,10 +159,6 @@ type VolumePlugin interface {
 | 
			
		||||
	// const.
 | 
			
		||||
	CanSupport(spec *Spec) bool
 | 
			
		||||
 | 
			
		||||
	// IsMigratedToCSI tests whether a CSIDriver implements this plugin's
 | 
			
		||||
	// functionality
 | 
			
		||||
	IsMigratedToCSI() bool
 | 
			
		||||
 | 
			
		||||
	// RequiresRemount returns true if this plugin requires mount calls to be
 | 
			
		||||
	// reexecuted. Atomically updating volumes, like Downward API, depend on
 | 
			
		||||
	// this to update the contents of the volume.
 | 
			
		||||
@@ -693,39 +689,6 @@ func (pm *VolumePluginMgr) FindPluginBySpec(spec *Spec) (VolumePlugin, error) {
 | 
			
		||||
	return matches[0], nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsPluginMigratableBySpec looks for a plugin that can support a given volume
 | 
			
		||||
// specification and whether that plugin is Migratable. If no plugins can
 | 
			
		||||
// support or more than one plugin can support it, return error.
 | 
			
		||||
func (pm *VolumePluginMgr) IsPluginMigratableBySpec(spec *Spec) (bool, error) {
 | 
			
		||||
	pm.mutex.Lock()
 | 
			
		||||
	defer pm.mutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	if spec == nil {
 | 
			
		||||
		return false, fmt.Errorf("could not find if plugin is migratable because volume spec is nil")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	matches := []VolumePlugin{}
 | 
			
		||||
	for _, v := range pm.plugins {
 | 
			
		||||
		if v.CanSupport(spec) {
 | 
			
		||||
			matches = append(matches, v)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if len(matches) == 0 {
 | 
			
		||||
		// Not a known plugin (flex) in which case it is not migratable
 | 
			
		||||
		return false, nil
 | 
			
		||||
	}
 | 
			
		||||
	if len(matches) > 1 {
 | 
			
		||||
		matchedPluginNames := []string{}
 | 
			
		||||
		for _, plugin := range matches {
 | 
			
		||||
			matchedPluginNames = append(matchedPluginNames, plugin.GetPluginName())
 | 
			
		||||
		}
 | 
			
		||||
		return false, fmt.Errorf("multiple volume plugins matched: %s", strings.Join(matchedPluginNames, ","))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return matches[0].IsMigratedToCSI(), nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// FindPluginByName fetches a plugin by name or by legacy name.  If no plugin
 | 
			
		||||
// is found, returns error.
 | 
			
		||||
func (pm *VolumePluginMgr) FindPluginByName(name string) (VolumePlugin, error) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user