Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.18/test-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ DriverInfo:
singleNodeVolume: true
snapshotDataSource: true
topology: true
InlineVolumes:
- shared: true
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.20/test-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ DriverInfo:
singleNodeVolume: true
snapshotDataSource: true
topology: true
InlineVolumes:
- shared: true
2 changes: 2 additions & 0 deletions deploy/kubernetes-distributed/test-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ DriverInfo:
persistence: true
singleNodeVolume: true
topology: true
InlineVolumes:
- shared: true
4 changes: 3 additions & 1 deletion pkg/hostpath/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ func (hp *hostPath) NodePublishVolume(ctx context.Context, req *csi.NodePublishV
volID := req.GetVolumeId()
volName := fmt.Sprintf("ephemeral-%s", volID)
kind := req.GetVolumeContext()[storageKind]
vol, err := hp.createVolume(req.GetVolumeId(), volName, maxStorageCapacity, mountAccess, ephemeralVolume, kind)
// Configurable size would be nice. For now we use a small, fixed volume size of 100Mi.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason why 100Mi is the chosen size?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's small enough that with the default fake capacity limits a large number of inline volumes can be created. But other than that, no.

volSize := int64(100 * 1024 * 1024)
vol, err := hp.createVolume(req.GetVolumeId(), volName, volSize, mountAccess, ephemeralVolume, kind)
if err != nil && !os.IsExist(err) {
glog.Error("ephemeral mode failed to create volume: ", err)
return nil, err
Expand Down