Skip to content

Commit

Permalink
nomad: fix leftover missed refactoring in consul policy checking
Browse files Browse the repository at this point in the history
  • Loading branch information
shoenig committed Jan 24, 2020
1 parent 28e8963 commit d88f25f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nomad/consul_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (c *consulACLsAPI) policyAllowsServiceWrite(task string, policyID string) (
return false, err
}

if c.allowsServiceWrite(task, cp) {
if cp.allowsServiceWrite(task) {
return true, nil
}

Expand Down
3 changes: 1 addition & 2 deletions nomad/consul_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ func TestConsulACLsAPI_allowsServiceWrite(t *testing.T) {
t.Parallel()

try := func(t *testing.T, task string, cp *ConsulPolicy, exp bool) {
cAPI := new(consulACLsAPI)
result := cAPI.allowsServiceWrite(task, cp)
result := cp.allowsServiceWrite(task)
require.Equal(t, exp, result)
}

Expand Down

0 comments on commit d88f25f

Please sign in to comment.