Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
schmichael committed Mar 20, 2018
1 parent 9f68df7 commit af3e8d2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion command/agent/node_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func TestHTTP_NodeDrain(t *testing.T) {
respW = httptest.NewRecorder()

// Make the request
obj, err = s.Server.NodeSpecificRequest(respW, req)
_, err = s.Server.NodeSpecificRequest(respW, req)
require.Nil(err)

out, err = state.NodeByID(nil, node.ID)
Expand Down
1 change: 0 additions & 1 deletion nomad/drainer/watch_jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ func TestDrainingJobWatcher_DrainJobs(t *testing.T) {
}
}
require.Nil(state.UpsertAllocs(index, replacements))
index++

// No jobs should be left!
require.Empty(jobWatcher.drainingJobs())
Expand Down
2 changes: 1 addition & 1 deletion nomad/fsm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func TestFSM_BatchUpdateNodeDrain(t *testing.T) {
}
req2 := structs.BatchNodeUpdateDrainRequest{
Updates: map[string]*structs.DrainUpdate{
node.ID: &structs.DrainUpdate{
node.ID: {
DrainStrategy: strategy,
},
},
Expand Down
4 changes: 2 additions & 2 deletions nomad/state/state_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,10 @@ func TestStateStore_BatchUpdateNodeDrain(t *testing.T) {
}

update := map[string]*structs.DrainUpdate{
n1.ID: &structs.DrainUpdate{
n1.ID: {
DrainStrategy: expectedDrain,
},
n2.ID: &structs.DrainUpdate{
n2.ID: {
DrainStrategy: expectedDrain,
},
}
Expand Down
1 change: 0 additions & 1 deletion scheduler/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ func (a *allocReconciler) computeGroup(group string, all allocSet) bool {
if deploymentPlaceReady {
// Do all destructive updates
min := helper.IntMin(len(destructive), limit)
limit -= min
desiredChanges.DestructiveUpdate += uint64(min)
desiredChanges.Ignore += uint64(len(destructive) - min)
for _, alloc := range destructive.nameOrder()[:min] {
Expand Down
6 changes: 3 additions & 3 deletions scheduler/reconcile_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ func TestAllocSet_filterByTainted(t *testing.T) {
require := require.New(t)

nodes := map[string]*structs.Node{
"draining": &structs.Node{
"draining": {
ID: "draining",
Drain: true,
},
"lost": &structs.Node{
"lost": {
ID: "lost",
Status: structs.NodeStatusDown,
},
"nil": nil,
"normal": &structs.Node{
"normal": {
ID: "normal",
Status: structs.NodeStatusReady,
},
Expand Down

0 comments on commit af3e8d2

Please sign in to comment.