Skip to content

Commit

Permalink
more linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan committed Mar 23, 2022
1 parent e793b5a commit 4585280
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions cmd/fleet/handleAck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (m mockBulk) Search(ctx context.Context, index string, body []byte, opts ..
ok bool
)
for _, a := range m.actions {
if a.ActionId == req.Query.Bool.Filter[0].Term.ActionID {
if a.ActionID == req.Query.Bool.Filter[0].Term.ActionID {
action = a
ok = true
}
Expand All @@ -151,7 +151,7 @@ func (m mockBulk) Search(ctx context.Context, index string, body []byte, opts ..
HitsT: es.HitsT{
Hits: []es.HitT{
{
Source: []byte(`{"action_id":"` + action.ActionId + `","type":"` + action.Type + `"}`),
Source: []byte(`{"action_id":"` + action.ActionID + `","type":"` + action.Type + `"}`),
},
},
},
Expand Down Expand Up @@ -283,7 +283,7 @@ func TestHandleAckEvents(t *testing.T) {
Message: http.StatusText(http.StatusOK),
}}),
bulker: mockBulk{actions: []model.Action{
{ActionId: "2b12dcd8-bde0-4045-92dc-c4b27668d733"},
{ActionID: "2b12dcd8-bde0-4045-92dc-c4b27668d733"},
}},
},
{
Expand All @@ -296,7 +296,7 @@ func TestHandleAckEvents(t *testing.T) {
res: newAckResponse(true, []AckResponseItem{newAckResponseItem(http.StatusInternalServerError)}),
bulker: mockBulk{
actions: []model.Action{
{ActionId: "2b12dcd8-bde0-4045-92dc-c4b27668d733"},
{ActionID: "2b12dcd8-bde0-4045-92dc-c4b27668d733"},
},
createErr: errors.New("network error"),
},
Expand All @@ -312,7 +312,7 @@ func TestHandleAckEvents(t *testing.T) {
res: newAckResponse(true, []AckResponseItem{newAckResponseItem(http.StatusServiceUnavailable)}),
bulker: mockBulk{
actions: []model.Action{
{ActionId: "2b12dcd8-bde0-4045-92dc-c4b27668d733"},
{ActionID: "2b12dcd8-bde0-4045-92dc-c4b27668d733"},
},
createErr: &es.ErrElastic{Status: http.StatusServiceUnavailable, Reason: http.StatusText(http.StatusServiceUnavailable)},
},
Expand All @@ -332,7 +332,7 @@ func TestHandleAckEvents(t *testing.T) {
}}),
bulker: mockBulk{
actions: []model.Action{
{ActionId: "2b12dcd8-bde0-4045-92dc-c4b27668d733", Type: "UPGRADE"},
{ActionID: "2b12dcd8-bde0-4045-92dc-c4b27668d733", Type: "UPGRADE"},
},
updateErr: &es.ErrElastic{Status: http.StatusServiceUnavailable, Reason: http.StatusText(http.StatusServiceUnavailable)},
},
Expand Down Expand Up @@ -391,10 +391,10 @@ func TestHandleAckEvents(t *testing.T) {
},
}),
bulker: mockBulk{actions: []model.Action{
{ActionId: "policy:2b12dcd8-bde0-4045-92dc-c4b27668d733:1:1"},
{ActionId: "1b12dcd8-bde0-4045-92dc-c4b27668d731", Type: "UNENROLL"},
{ActionId: "ab12dcd8-bde0-4045-92dc-c4b27668d73a", Type: "UPGRADE"},
{ActionId: "2b12dcd8-bde0-4045-92dc-c4b27668d733"},
{ActionID: "policy:2b12dcd8-bde0-4045-92dc-c4b27668d733:1:1"},
{ActionID: "1b12dcd8-bde0-4045-92dc-c4b27668d731", Type: "UNENROLL"},
{ActionID: "ab12dcd8-bde0-4045-92dc-c4b27668d73a", Type: "UPGRADE"},
{ActionID: "2b12dcd8-bde0-4045-92dc-c4b27668d733"},
}},
err: &HTTPError{Status: http.StatusNotFound},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/coordinator/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ func runUnenrollerWork(ctx context.Context, bulker bulk.Bulk, policyId string, u
if err != nil {
return err
}
agentIds[i] = agent.ID
agentIds[i] = agent.Id
}

zlog.Info().
Expand All @@ -516,7 +516,7 @@ func unenrollAgent(ctx context.Context, zlog zerolog.Logger, bulker bulk.Bulk, a
apiKeys := getAPIKeyIDs(agent)

zlog = zlog.With().
Str(logger.AgentId, agent.ID).
Str(logger.AgentId, agent.Id).
Strs(logger.ApiKeyId, apiKeys).
Logger()

Expand All @@ -529,7 +529,7 @@ func unenrollAgent(ctx context.Context, zlog zerolog.Logger, bulker bulk.Bulk, a
return err
}
}
if err = bulker.Update(ctx, agentsIndex, agent.ID, body, bulk.WithRefresh()); err != nil {
if err = bulker.Update(ctx, agentsIndex, agent.Id, body, bulk.WithRefresh()); err != nil {
zlog.Error().Err(err).Msg("Fail unenrollAgent record update")
}

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/dl/action_results.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ func createActionResult(ctx context.Context, bulker bulk.Bulk, index string, acr
return "", nil
}

return bulker.Create(ctx, index, acr.ID, body, bulk.WithRefresh())
return bulker.Create(ctx, index, acr.Id, body, bulk.WithRefresh())
}

0 comments on commit 4585280

Please sign in to comment.