Skip to content

Commit ceb58a4

Browse files
authored
Merge pull request kubernetes#126323 from saschagrunert/image-volume-runtime-panic
Fix runtime panic in imagevolume `CanSupport` method
2 parents a145f15 + a43cc08 commit ceb58a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/volume/image/image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (o *imagePlugin) GetPluginName() string { return
4949
func (o *imagePlugin) GetVolumeName(spec *volume.Spec) (string, error) { return o.spec.Name(), nil }
5050

5151
func (o *imagePlugin) CanSupport(spec *volume.Spec) bool {
52-
return spec.Volume.Image != nil
52+
return spec != nil && spec.Volume != nil && spec.Volume.Image != nil
5353
}
5454

5555
func (o *imagePlugin) NewMounter(spec *volume.Spec, podRef *v1.Pod) (volume.Mounter, error) {

0 commit comments

Comments
 (0)