pbacsko commented on code in PR #950:
URL: https://github.com/apache/yunikorn-k8shim/pull/950#discussion_r1950434693


##########
pkg/plugin/predicates/predicate_manager_test.go:
##########
@@ -1094,6 +1094,11 @@ func makeResources(milliCPU, memory, pods, extendedA, 
storage, hugePageA int64)
 func newPodWithPort(hostPorts ...int) *v1.Pod {
        var networkPorts []v1.ContainerPort
        for _, port := range hostPorts {
+               // Check for integer overflow before conversion
+               if port <= 0 || port > 65536 {
+                       log.Log(log.Test).Error("invalid port number", 
zap.Int("port", port))
+                       continue
+               }

Review Comment:
   This is test code, no need to be this vigilant. Use `nolint` to suppress the 
linter.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to