@@ -75,6 +75,7 @@ type ScaleControllerServer struct {
7575func (cs * ScaleControllerServer ) IfSameVolReqInProcess (scVol * scaleVolume ) (bool , error ) {
7676 capacity , volpresent := cs .Driver .reqmap [scVol .VolName ]
7777 if volpresent {
78+ /* #nosec G115 -- false positive */
7879 if capacity == int64 (scVol .VolSize ) {
7980 return true , nil
8081 } else {
@@ -930,7 +931,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C
930931 return & csi.CreateVolumeResponse {
931932 Volume : & csi.Volume {
932933 VolumeId : volID ,
933- CapacityBytes : int64 (scaleVol .VolSize ),
934+ CapacityBytes : int64 (scaleVol .VolSize ), // #nosec G115 -- false positive
934935 VolumeContext : req .GetParameters (),
935936 ContentSource : volSrc ,
936937 },
@@ -978,7 +979,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C
978979
979980 /* Update driver map with new volume. Make sure to defer delete */
980981
981- cs .Driver .reqmap [scaleVol .VolName ] = int64 (scaleVol .VolSize )
982+ cs .Driver .reqmap [scaleVol .VolName ] = int64 (scaleVol .VolSize ) // #nosec G115 -- false positive
982983 defer delete (cs .Driver .reqmap , scaleVol .VolName )
983984
984985 var targetPath string
@@ -1051,7 +1052,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C
10511052 return & csi.CreateVolumeResponse {
10521053 Volume : & csi.Volume {
10531054 VolumeId : volID ,
1054- CapacityBytes : int64 (scaleVol .VolSize ),
1055+ CapacityBytes : int64 (scaleVol .VolSize ), // #nosec G115 -- false positive
10551056 VolumeContext : req .GetParameters (),
10561057 ContentSource : volSrc ,
10571058 },
@@ -1081,10 +1082,11 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr
10811082 }
10821083
10831084 scaleVol .VolName = volName
1085+ // #nosec G115 -- false positive
10841086 if scaleVol .IsFilesetBased && uint64 (volSize ) < smallestVolSize {
10851087 scaleVol .VolSize = smallestVolSize
10861088 } else {
1087- scaleVol .VolSize = uint64 (volSize )
1089+ scaleVol .VolSize = uint64 (volSize ) // #nosec G115 -- false positive
10881090 }
10891091
10901092 /* Get details for Primary Cluster */
@@ -1304,7 +1306,7 @@ func (cs *ScaleControllerServer) getCopyJobStatus(ctx context.Context, req *csi.
13041306 return & csi.CreateVolumeResponse {
13051307 Volume : & csi.Volume {
13061308 VolumeId : volID ,
1307- CapacityBytes : int64 (scaleVol .VolSize ),
1309+ CapacityBytes : int64 (scaleVol .VolSize ), // #nosec G115 -- false positive
13081310 VolumeContext : req .GetParameters (),
13091311 ContentSource : volSrc ,
13101312 },
@@ -1339,7 +1341,7 @@ func (cs *ScaleControllerServer) getCopyJobStatus(ctx context.Context, req *csi.
13391341 return & csi.CreateVolumeResponse {
13401342 Volume : & csi.Volume {
13411343 VolumeId : volID ,
1342- CapacityBytes : int64 (scaleVol .VolSize ),
1344+ CapacityBytes : int64 (scaleVol .VolSize ), // #nosec G115 -- false positive
13431345 VolumeContext : req .GetParameters (),
13441346 ContentSource : volSrc ,
13451347 },
@@ -3208,7 +3210,7 @@ func (cs *ScaleControllerServer) ControllerExpandVolume(ctx context.Context, req
32083210 if capRange == nil {
32093211 return nil , status .Error (codes .InvalidArgument , "capacity range not provided" )
32103212 }
3211- capacity := uint64 (capRange .GetRequiredBytes ())
3213+ capacity := uint64 (capRange .GetRequiredBytes ()) // #nosec G115 -- false positive
32123214
32133215 volumeIDMembers , err := getVolIDMembers (volID )
32143216
0 commit comments