Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
  • Loading branch information
AleksZimin committed Apr 19, 2024
1 parent 0debfe4 commit 4939353
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions images/sds-local-volume-csi/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,11 @@ func (d *Driver) NodePublishVolume(ctx context.Context, request *csi.NodePublish
d.inFlight.Delete(volumeID)
}()

fsType := ""

switch volCap.GetAccessType().(type) {
case *csi.VolumeCapability_Block:
d.log.Trace("[NodePublishVolume] Block volume detected.")
err := d.storeManager.BindMount(source, target, "", mountOptions)
if err != nil {
return nil, status.Errorf(codes.Internal, "[NodePublishVolume] Error bind mounting block volume %q. Source: %q. Target: %q: %v", volumeID, source, target, err)
}
case *csi.VolumeCapability_Mount:
d.log.Trace("[NodePublishVolume] Mount volume detected.")
mountVolume := volCap.GetMount()
Expand All @@ -243,13 +241,11 @@ func (d *Driver) NodePublishVolume(ctx context.Context, request *csi.NodePublish
}

mountOptions = collectMountOptions(fsType, mountVolume.GetMountFlags(), mountOptions)
}

err := d.storeManager.BindMount(source, target, fsType, mountOptions)

if err != nil {
return nil, status.Errorf(codes.Internal, "[NodePublishVolume] Error bind mounting volume %q. Source: %q. Target: %q: %v", volumeID, source, target, err)
}

err := d.storeManager.BindMount(source, target, fsType, mountOptions)
if err != nil {
return nil, status.Errorf(codes.Internal, "[NodePublishVolume] Error bind mounting volume %q. Source: %q. Target: %q. Mount options:%v. Err: %v", volumeID, source, target, mountOptions, err)
}

return &csi.NodePublishVolumeResponse{}, nil
Expand Down

0 comments on commit 4939353

Please sign in to comment.