diff --git a/nomad/consul_policy.go b/nomad/consul_policy.go index c860f0871..3630a4df7 100644 --- a/nomad/consul_policy.go +++ b/nomad/consul_policy.go @@ -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 } diff --git a/nomad/consul_policy_test.go b/nomad/consul_policy_test.go index 35f5d407b..f7cde067f 100644 --- a/nomad/consul_policy_test.go +++ b/nomad/consul_policy_test.go @@ -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) }