From bd023f352e466b47a773241c34249ad822bc4c91 Mon Sep 17 00:00:00 2001
From: Pierre Souchay
Date: Mon, 2 Jul 2018 17:39:34 +0200
Subject: [PATCH] Updated swith case to use same branch for async-cache and
extend-cache
---
agent/acl.go | 3 +--
agent/consul/acl.go | 3 +--
agent/consul/config.go | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/agent/acl.go b/agent/acl.go
index 1143da97cc..5c4deb7cc8 100644
--- a/agent/acl.go
+++ b/agent/acl.go
@@ -103,8 +103,7 @@ func newACLManager(config *config.RuntimeConfig) (*aclManager, error) {
down = acl.AllowAll()
case "deny":
down = acl.DenyAll()
- case "extend-cache":
- case "async-cache":
+ case "async-cache", "extend-cache":
// Leave the down policy as nil to signal this.
default:
return nil, fmt.Errorf("invalid ACL down policy %q", config.ACLDownPolicy)
diff --git a/agent/consul/acl.go b/agent/consul/acl.go
index 23bdbff356..4dbfe2b39e 100644
--- a/agent/consul/acl.go
+++ b/agent/consul/acl.go
@@ -277,8 +277,7 @@ ACL_DOWN:
case "allow":
c.fireResult(id, acl.AllowAll(), nil)
return
- case "async-cache":
- case "extend-cache":
+ case "async-cache", "extend-cache":
if cached != nil {
c.fireResult(id, cached.ACL, nil)
return
diff --git a/agent/consul/config.go b/agent/consul/config.go
index 570a07c163..b878d9a99d 100644
--- a/agent/consul/config.go
+++ b/agent/consul/config.go
@@ -379,8 +379,7 @@ func (c *Config) CheckACL() error {
switch c.ACLDownPolicy {
case "allow":
case "deny":
- case "async-cache":
- case "extend-cache":
+ case "async-cache", "extend-cache":
default:
return fmt.Errorf("Unsupported down ACL policy: %s", c.ACLDownPolicy)
}