From 235f4d27ac2e32b9d4a656d3f14626603dfa4165 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Mon, 21 Aug 2017 17:09:09 -0700 Subject: [PATCH] Address @chelseakomlo comments --- command/agent/config.go | 2 +- nomad/acl_endpoint.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/command/agent/config.go b/command/agent/config.go index 6aa0461b5..7382a2666 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -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 diff --git a/nomad/acl_endpoint.go b/nomad/acl_endpoint.go index 0ad63dafd..3fd780447 100644 --- a/nomad/acl_endpoint.go +++ b/nomad/acl_endpoint.go @@ -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 }