Skip to content

Commit

Permalink
refactor: Set the Config Version when creating Config Client
Browse files Browse the repository at this point in the history
This centralizes the config version for all services.

closes #200

BREAKING CHANGE: Configuration in Consul now under the `/2.0/` path

Signed-off-by: lenny <[email protected]>
  • Loading branch information
lenny committed Apr 6, 2021
1 parent 7d55b1a commit 61a3f34
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bootstrap/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"sync"

Expand All @@ -40,7 +41,10 @@ import (
"github.com/BurntSushi/toml"
)

const writableKey = "/Writable"
const (
writableKey = "/Writable"
configVersion = "2.0"
)

// UpdatedStream defines the stream type that is notified by ListenForChanges when a configuration update is received.
type UpdatedStream chan struct{}
Expand Down Expand Up @@ -312,7 +316,7 @@ func (cp *Processor) createProviderClient(
accessTokenFile string,
providerConfig types.ServiceConfig) (configuration.Client, error) {

providerConfig.BasePath = configStem + serviceKey
providerConfig.BasePath = filepath.Join(configStem, configVersion, serviceKey)
providerConfig.AccessToken = accessTokenFile

cp.Logger.Info(fmt.Sprintf(
Expand Down

0 comments on commit 61a3f34

Please sign in to comment.