Merge pull request #78248 from cwdsuzhou/optimize_err_log

Add error info for plugin do not support attachment
This commit is contained in:
Kubernetes Prow Robot 2019-05-29 00:53:17 -07:00 committed by GitHub
commit 306b6f330d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -287,6 +287,9 @@ func (asw *actualStateOfWorld) AddVolumeNode(
}
attachableVolumePlugin, err := asw.volumePluginMgr.FindAttachablePluginBySpec(volumeSpec)
if err != nil || attachableVolumePlugin == nil {
if attachableVolumePlugin == nil {
err = fmt.Errorf("plugin do not support attachment")
}
return "", fmt.Errorf(
"failed to get AttachablePlugin from volumeSpec for volume %q err=%v",
volumeSpec.Name(),

View File

@ -225,6 +225,9 @@ func (dsw *desiredStateOfWorld) AddPod(
attachableVolumePlugin, err := dsw.volumePluginMgr.FindAttachablePluginBySpec(volumeSpec)
if err != nil || attachableVolumePlugin == nil {
if attachableVolumePlugin == nil {
err = fmt.Errorf("plugin do not support attachment")
}
return "", fmt.Errorf(
"failed to get AttachablePlugin from volumeSpec for volume %q err=%v",
volumeSpec.Name(),