Skip to content

Commit

Permalink
fix #34 - default to iSCSI for backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
chihyuwu committed Apr 29, 2022
1 parent ebe7c1d commit fc33592
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/driver/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,8 @@ func (ns *nodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol
switch req.VolumeContext["protocol"] {
case utils.ProtocolSmb:
return ns.nodeStageSMBVolume(ctx, spec, req.GetSecrets())
case utils.ProtocolIscsi:
return ns.nodeStageISCSIVolume(ctx, spec)
default:
return nil, status.Error(codes.InvalidArgument, "Unknown protocol")
return ns.nodeStageISCSIVolume(ctx, spec)
}
}

Expand Down Expand Up @@ -408,7 +406,7 @@ func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis
if err := ns.Mounter.Interface.Mount(stagingTargetPath, targetPath, "", options); err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
case utils.ProtocolIscsi:
default:
if err := ns.loginTarget(volumeId); err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
Expand All @@ -426,8 +424,6 @@ func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
default:
return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Unknown protocol: %s", req.VolumeContext["protocol"]))
}

return &csi.NodePublishVolumeResponse{}, nil
Expand Down

0 comments on commit fc33592

Please sign in to comment.