Skip to content

Commit 306b6f3

Browse files
authored
Merge pull request kubernetes#78248 from cwdsuzhou/optimize_err_log
Add error info for plugin do not support attachment
2 parents 501092c + e39ec09 commit 306b6f3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/controller/volume/attachdetach/cache/actual_state_of_world.go

+3
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ func (asw *actualStateOfWorld) AddVolumeNode(
287287
}
288288
attachableVolumePlugin, err := asw.volumePluginMgr.FindAttachablePluginBySpec(volumeSpec)
289289
if err != nil || attachableVolumePlugin == nil {
290+
if attachableVolumePlugin == nil {
291+
err = fmt.Errorf("plugin do not support attachment")
292+
}
290293
return "", fmt.Errorf(
291294
"failed to get AttachablePlugin from volumeSpec for volume %q err=%v",
292295
volumeSpec.Name(),

pkg/controller/volume/attachdetach/cache/desired_state_of_world.go

+3
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ func (dsw *desiredStateOfWorld) AddPod(
225225

226226
attachableVolumePlugin, err := dsw.volumePluginMgr.FindAttachablePluginBySpec(volumeSpec)
227227
if err != nil || attachableVolumePlugin == nil {
228+
if attachableVolumePlugin == nil {
229+
err = fmt.Errorf("plugin do not support attachment")
230+
}
228231
return "", fmt.Errorf(
229232
"failed to get AttachablePlugin from volumeSpec for volume %q err=%v",
230233
volumeSpec.Name(),

0 commit comments

Comments
 (0)