Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Logiraptor committed Dec 13, 2022
1 parent c8a748a commit bb49a68
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions component/mimir/rules/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type ruleGroupDiff struct {
Desired mimirClient.RuleGroup
}

func diffRuleState(desired map[string][]mimirClient.RuleGroup, actual map[string][]mimirClient.RuleGroup) (map[string][]ruleGroupDiff, error) {
func diffRuleState(desired map[string][]mimirClient.RuleGroup, actual map[string][]mimirClient.RuleGroup) map[string][]ruleGroupDiff {
seen := map[string]bool{}

diff := make(map[string][]ruleGroupDiff)
Expand Down Expand Up @@ -50,7 +50,7 @@ func diffRuleState(desired map[string][]mimirClient.RuleGroup, actual map[string
diff[namespace] = subDiff
}

return diff, nil
return diff
}

func diffRuleNamespaceState(desired []mimirClient.RuleGroup, actual []mimirClient.RuleGroup) []ruleGroupDiff {
Expand Down
3 changes: 1 addition & 2 deletions component/mimir/rules/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ groups:

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
actual, err := diffRuleState(tc.desired, tc.actual)
require.NoError(t, err)
actual := diffRuleState(tc.desired, tc.actual)
requireEqualRuleDiffs(t, tc.expected, actual)
})
}
Expand Down
6 changes: 1 addition & 5 deletions component/mimir/rules/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ func (c *Component) reconcileState(ctx context.Context) error {
return err
}

diffs, err := diffRuleState(desiredState, c.currentState)
if err != nil {
return err
}

diffs := diffRuleState(desiredState, c.currentState)
errs := multierror.New()
for ns, diff := range diffs {
err = c.applyChanges(ctx, ns, diff)
Expand Down

0 comments on commit bb49a68

Please sign in to comment.