Skip to content

Commit 480de9e

Browse files
author
zhuc
committed
Need to set VolumeContentSource if creating volume from snapshot
1 parent 670a96b commit 480de9e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/hostpath/controllerserver.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,17 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
193193
}
194194
}
195195

196+
if req.GetVolumeContentSource() != nil {
197+
return &csi.CreateVolumeResponse{
198+
Volume: &csi.Volume{
199+
VolumeId: volumeID,
200+
CapacityBytes: req.GetCapacityRange().GetRequiredBytes(),
201+
VolumeContext: req.GetParameters(),
202+
ContentSource: req.GetVolumeContentSource(),
203+
},
204+
}, nil
205+
}
206+
196207
return &csi.CreateVolumeResponse{
197208
Volume: &csi.Volume{
198209
VolumeId: volumeID,

0 commit comments

Comments
 (0)