Skip to content

Commit b61a2e5

Browse files
committed
fix: suppress gosec G115 for schedulable pods length cast
The len(SchedulablePods) is bounded by cluster size and cannot overflow int32.
1 parent b376d68 commit b61a2e5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/scheduler/statefulset/scheduler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ func (s *StatefulSetScheduler) scheduleVPod(ctx context.Context, vpod scheduler.
387387
// Cap at schedulable pods to avoid requeueing when pods aren't ready yet.
388388
target := vpod.GetVReplicas()
389389
if s.minReplicas > target {
390-
schedulable := int32(len(state.SchedulablePods))
390+
schedulable := int32(len(state.SchedulablePods)) //nolint:gosec // G115: len is bounded by cluster size, cannot overflow int32
391391
if s.minReplicas < schedulable {
392392
target = s.minReplicas
393393
} else {

0 commit comments

Comments
 (0)