Address @chelseakomlo comments

This commit is contained in:
Armon Dadgar
2017-08-21 17:09:09 -07:00
parent 9b6144d0d6
commit 235f4d27ac
2 changed files with 4 additions and 1 deletions

View File

@@ -940,7 +940,7 @@ func isTooManyColons(err error) bool {
return err != nil && strings.Contains(err.Error(), tooManyColons)
}
// Merge is used to merge two ACL configs together
// Merge is used to merge two ACL configs together. The settings from the input always take precedence.
func (a *ACLConfig) Merge(b *ACLConfig) *ACLConfig {
result := *a

View File

@@ -108,6 +108,9 @@ func (a *ACL) ListPolicies(args *structs.ACLPolicyListRequest, reply *structs.AC
if err != nil {
return err
}
// Ensure we never set the index to zero, otherwise a blocking query cannot be used.
// We floor the index at one, since realistically the first write must have a higher index.
if index == 0 {
index = 1
}