Support Consul KV Enterprise namespaces
Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
parent
d969e59911
commit
b84829336d
23 changed files with 118 additions and 43 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue