Skip to content

Commit

Permalink
Update pkg/capacity/manager.go
Browse files Browse the repository at this point in the history
Co-authored-by: Matous Jobanek <mjobanek@redhat.com>
  • Loading branch information
fbm3307 and MatousJobanek authored Jan 10, 2025
1 parent 447be92 commit b1eb15e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/capacity/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type (

func hasNotReachedMaxNumberOfSpacesThreshold(counts counter.Counts) spaceProvisionerConfigPredicate {
return func(spc *toolchainv1alpha1.SpaceProvisionerConfig) bool {
//the value of this is not going to be negative and it won't overflow, hence its okay to ignore the overflow linter error
// the numbers of Spaces per cluster shouldn't be negative, so it's fine to cast it to uint without worrying about the overflow error, and thus also ignore the linter
numberOfSpaces := uint(counts.SpacesPerClusterCounts[spc.Spec.ToolchainCluster]) // nolint:gosec
threshold := spc.Spec.CapacityThresholds.MaxNumberOfSpaces
return threshold == 0 || numberOfSpaces < threshold
Expand Down

0 comments on commit b1eb15e

Please sign in to comment.