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 <[email protected]>
  • Loading branch information
fbm3307 and MatousJobanek authored Jan 10, 2025
1 parent 0cc1386 commit 447be92
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 @@ -46,7 +46,7 @@ func hasEnoughMemoryCapacity(status *toolchainv1alpha1.ToolchainStatus) spacePro
func hasMemberEnoughMemoryCapacity(memberStatus toolchainv1alpha1.Member, threshold uint) bool {
if len(memberStatus.MemberStatus.ResourceUsage.MemoryUsagePerNodeRole) > 0 {
for _, usagePerNode := range memberStatus.MemberStatus.ResourceUsage.MemoryUsagePerNodeRole {
//We do not expect this value to be negative and it won't overflow, hence its okay to ignore the overflow linter error
// the memory utilization threshold should be max 100, so it's fine to cast it to int without worrying about the overflow error, thus ignoring the linter here
if usagePerNode >= int(threshold) { // nolint:gosec
return false
}
Expand Down

0 comments on commit 447be92

Please sign in to comment.