nomad: fix leftover missed refactoring in consul policy checking
This commit is contained in:
parent
057f117592
commit
ee89a754f1
|
@ -94,7 +94,7 @@ func (c *consulACLsAPI) policyAllowsServiceWrite(task string, policyID string) (
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.allowsServiceWrite(task, cp) {
|
if cp.allowsServiceWrite(task) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,8 +94,7 @@ func TestConsulACLsAPI_allowsServiceWrite(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
try := func(t *testing.T, task string, cp *ConsulPolicy, exp bool) {
|
try := func(t *testing.T, task string, cp *ConsulPolicy, exp bool) {
|
||||||
cAPI := new(consulACLsAPI)
|
result := cp.allowsServiceWrite(task)
|
||||||
result := cAPI.allowsServiceWrite(task, cp)
|
|
||||||
require.Equal(t, exp, result)
|
require.Equal(t, exp, result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue