1
0
Fork 0

Support Consul KV Enterprise namespaces

Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
Kevin Pollet 2022-01-12 14:42:21 +01:00 committed by GitHub
parent d969e59911
commit b84829336d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 118 additions and 43 deletions

View file

@ -1,7 +1,9 @@
package consul
import (
"github.com/abronan/valkeyrie/store"
"errors"
"github.com/kvtools/valkeyrie/store"
"github.com/traefik/traefik/v2/pkg/provider"
"github.com/traefik/traefik/v2/pkg/provider/kv"
)
@ -21,5 +23,11 @@ func (p *Provider) SetDefaults() {
// Init the provider.
func (p *Provider) Init() error {
// Wildcard namespace allows fetching KV values from any namespace for recursive requests (see https://www.consul.io/api/kv#ns).
// As we are not supporting multiple namespaces at the same time, wildcard namespace is not allowed.
if p.Namespace == "*" {
return errors.New("wildcard namespace is not supported")
}
return p.Provider.Init(store.CONSUL, "consul")
}