Skip to content

Commit

Permalink
Clean Lint
Browse files Browse the repository at this point in the history
Lint is preventing the merge of PR #98
  • Loading branch information
isaacnboyd committed Jan 19, 2024
1 parent 127cba8 commit fa4336b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 5 additions & 3 deletions pkg/capacity/capacity.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,18 @@ func splitTaint(taint string) (string, string, string) {
value = parts[0]
effect = parts[1]
return key, value, effect
}

if strings.Contains(taint, ":") {

} else if strings.Contains(taint, ":") {
parts = strings.Split(taint, ":")
key = parts[0]
effect = parts[1]
value = ""
return key, value, effect

} else {
return "", "", ""
}

}

// This loops through the original nodeList from getPodsAndNodes and checks each node individually for the list of taints. If a node contains any taint in the list, it is removedfrom nodeList, otherwise it is remains.
Expand Down
3 changes: 0 additions & 3 deletions pkg/capacity/capacity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ func TestGetPodsAndNodes(t *testing.T) {
"other/mypod3",
}, listPods(podList))


podList, nodeList = getPodsAndNodes(clientset, true, "", "hello=world", "", "", "")
assert.Equal(t, []string{"mynode"}, listNodes(nodeList))
assert.Equal(t, []string{
Expand Down Expand Up @@ -92,15 +91,13 @@ func TestGetPodsAndNodes(t *testing.T) {
"other/mypod3",
}, listPods(podList))


podList, nodeList = getPodsAndNodes(clientset, false, "a=test", "", "", "", "")
assert.Equal(t, []string{"mynode", "mynode2", "mynode3", "mynode4"}, listNodes(nodeList))

assert.Equal(t, []string{
"default/mypod",
}, listPods(podList))


podList, nodeList = getPodsAndNodes(clientset, false, "a=test,b!=test", "", "", "app=true", "")
assert.Equal(t, []string{"mynode", "mynode2", "mynode3", "mynode4"}, listNodes(nodeList))
assert.Equal(t, []string{
Expand Down

0 comments on commit fa4336b

Please sign in to comment.