mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
return name when error occurred in csi-translation
This commit is contained in:
parent
fe91bc257b
commit
81a0ea3da3
@ -150,14 +150,14 @@ func (CSITranslator) GetInTreePluginNameFromSpec(pv *v1.PersistentVolume, vol *v
|
|||||||
return curPlugin.GetInTreePluginName(), nil
|
return curPlugin.GetInTreePluginName(), nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "", fmt.Errorf("could not find in-tree plugin name from persistent volume %v", pv)
|
return "", fmt.Errorf("could not find in-tree plugin name from persistent volume %s", pv.Name)
|
||||||
} else if vol != nil {
|
} else if vol != nil {
|
||||||
for _, curPlugin := range inTreePlugins {
|
for _, curPlugin := range inTreePlugins {
|
||||||
if curPlugin.CanSupportInline(vol) {
|
if curPlugin.CanSupportInline(vol) {
|
||||||
return curPlugin.GetInTreePluginName(), nil
|
return curPlugin.GetInTreePluginName(), nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "", fmt.Errorf("could not find in-tree plugin name from volume %v", vol)
|
return "", fmt.Errorf("could not find in-tree plugin name from volume %s", vol.Name)
|
||||||
} else {
|
} else {
|
||||||
return "", errors.New("both persistent volume and volume are nil")
|
return "", errors.New("both persistent volume and volume are nil")
|
||||||
}
|
}
|
||||||
@ -171,7 +171,7 @@ func (CSITranslator) GetCSINameFromInTreeName(pluginName string) (string, error)
|
|||||||
return csiDriverName, nil
|
return csiDriverName, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "", fmt.Errorf("could not find CSI Driver name for plugin %v", pluginName)
|
return "", fmt.Errorf("could not find CSI Driver name for plugin %s", pluginName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetInTreeNameFromCSIName returns the name of the in-tree plugin superseded by
|
// GetInTreeNameFromCSIName returns the name of the in-tree plugin superseded by
|
||||||
@ -180,7 +180,7 @@ func (CSITranslator) GetInTreeNameFromCSIName(pluginName string) (string, error)
|
|||||||
if plugin, ok := inTreePlugins[pluginName]; ok {
|
if plugin, ok := inTreePlugins[pluginName]; ok {
|
||||||
return plugin.GetInTreePluginName(), nil
|
return plugin.GetInTreePluginName(), nil
|
||||||
}
|
}
|
||||||
return "", fmt.Errorf("could not find In-Tree driver name for CSI plugin %v", pluginName)
|
return "", fmt.Errorf("could not find In-Tree driver name for CSI plugin %s", pluginName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsPVMigratable tests whether there is migration logic for the given Persistent Volume
|
// IsPVMigratable tests whether there is migration logic for the given Persistent Volume
|
||||||
@ -208,5 +208,5 @@ func (CSITranslator) RepairVolumeHandle(driverName, volumeHandle, nodeID string)
|
|||||||
if plugin, ok := inTreePlugins[driverName]; ok {
|
if plugin, ok := inTreePlugins[driverName]; ok {
|
||||||
return plugin.RepairVolumeHandle(volumeHandle, nodeID)
|
return plugin.RepairVolumeHandle(volumeHandle, nodeID)
|
||||||
}
|
}
|
||||||
return "", fmt.Errorf("could not find In-Tree driver name for CSI plugin %v", driverName)
|
return "", fmt.Errorf("could not find In-Tree driver name for CSI plugin %s", driverName)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user