You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@yunikorn.apache.org by "Peter Bacsko (Jira)" <ji...@apache.org> on 2024/08/05 13:30:00 UTC

[jira] [Created] (YUNIKORN-2787) Eliminate gosec lint warnings

Peter Bacsko created YUNIKORN-2787:
--------------------------------------

             Summary: Eliminate gosec lint warnings 
                 Key: YUNIKORN-2787
                 URL: https://issues.apache.org/jira/browse/YUNIKORN-2787
             Project: Apache YuniKorn
          Issue Type: Improvement
          Components: core - common
            Reporter: Peter Bacsko
            Assignee: Peter Bacsko


Use the nolint directive to get rid of the following warnings from the test code

{noformat}
running golangci-lint
pkg/scheduler/objects/node_collection_test.go:315:18: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, nodes[0].NodeID, "node-2", "wrong node 0")
	                ^
pkg/scheduler/objects/node_collection_test.go:316:18: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, nodes[1].NodeID, "node-4", "wrong node 1")
	                ^
pkg/scheduler/objects/node_collection_test.go:317:18: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, nodes[2].NodeID, "node-1", "wrong node 2")
	                ^
pkg/scheduler/objects/node_collection_test.go:318:18: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, nodes[3].NodeID, "node-3", "wrong node 3")
	                ^
pkg/scheduler/objects/nodesorting_test.go:200:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node1.NodeID, nodes[0].NodeID, "wrong initial node (fair)")
	                              ^
pkg/scheduler/objects/nodesorting_test.go:201:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node2.NodeID, nodes[1].NodeID, "wrong second node (fair)")
	                              ^
pkg/scheduler/objects/nodesorting_test.go:214:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node2.NodeID, nodes[0].NodeID, "wrong initial node (binpacking)")
	                              ^
pkg/scheduler/objects/nodesorting_test.go:215:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node1.NodeID, nodes[1].NodeID, "wrong second node (binpacking)")
	                              ^
pkg/scheduler/objects/nodesorting_test.go:244:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node1.NodeID, nodes[0].NodeID, "wrong initial node (binpacking, empty allocation)")
	                              ^
pkg/scheduler/objects/nodesorting_test.go:245:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node2.NodeID, nodes[1].NodeID, "wrong second node (binpacking, empty allocation)")
	                              ^
pkg/scheduler/objects/nodesorting_test.go:256:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node1.NodeID, nodes[0].NodeID, "wrong initial node (fair, empty allocation)")
	                              ^
pkg/scheduler/objects/nodesorting_test.go:257:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node2.NodeID, nodes[1].NodeID, "wrong second node (fair, empty allocation)")
	                              ^
pkg/scheduler/objects/nodesorting_test.go:274:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node2.NodeID, nodes[0].NodeID, "wrong initial node (binpacking, node2 half-filled)")
	                              ^
pkg/scheduler/objects/nodesorting_test.go:275:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node1.NodeID, nodes[1].NodeID, "wrong second node (binpacking, node2 half-filled")
	                              ^
pkg/scheduler/objects/nodesorting_test.go:287:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node1.NodeID, nodes[0].NodeID, "wrong initial node (fair, node2 half-filled)")
	                              ^
pkg/scheduler/objects/nodesorting_test.go:288:32: G602: Potentially accessing slice out of bounds (gosec)
	assert.Equal(t, node2.NodeID, nodes[1].NodeID, "wrong second node (binpacking, node2 half-filled")
	                              ^
make: *** [Makefile:131: lint] Error 1
{noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: issues-help@yunikorn.apache.org