File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -519,9 +519,11 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage
519
519
}
520
520
}
521
521
522
- err = ns .DeviceCache .AddVolume (volumeID )
523
- if err != nil {
524
- klog .Warningf ("Error adding volume %s to cache: %v" , volumeID , err )
522
+ if ns .DeviceCache != nil {
523
+ err = ns .DeviceCache .AddVolume (volumeID )
524
+ if err != nil {
525
+ klog .Warningf ("Error adding volume %s to cache: %v" , volumeID , err )
526
+ }
525
527
}
526
528
527
529
klog .V (4 ).Infof ("NodeStageVolume succeeded on %v to %s" , volumeID , stagingTargetPath )
@@ -639,7 +641,9 @@ func (ns *GCENodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUns
639
641
}
640
642
}
641
643
642
- ns .DeviceCache .RemoveVolume (volumeID )
644
+ if ns .DeviceCache != nil {
645
+ ns .DeviceCache .RemoveVolume (volumeID )
646
+ }
643
647
644
648
klog .V (4 ).Infof ("NodeUnstageVolume succeeded on %v from %s" , volumeID , stagingTargetPath )
645
649
return & csi.NodeUnstageVolumeResponse {}, nil
You can’t perform that action at this time.
0 commit comments