Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Update config_source.go
Browse files Browse the repository at this point in the history
  • Loading branch information
paladin-devops authored Jan 12, 2023
1 parent 621dfbc commit 54bb172
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/server/boltdbstate/config_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ func (s *State) configSourceIndexSet(txn *memdb.Txn, id []byte, value *pb.Config
// configSourceIndexInit initializes the config index from persisted data.
func (s *State) configSourceIndexInit(dbTxn *bolt.Tx, memTxn *memdb.Txn) error {
bucket := dbTxn.Bucket(configSourceBucket)

// Regex to match for the names of any config sourcer plugins v0.10.5 and earlier
re := regexp.MustCompile(`aws-ssm|consul|kubernetes|null|packer|terraform-cloud|vault`)

return bucket.ForEach(func(k, v []byte) error {
var value pb.ConfigSource
if err := proto.Unmarshal(v, &value); err != nil {
Expand All @@ -312,7 +316,6 @@ func (s *State) configSourceIndexInit(dbTxn *bolt.Tx, memTxn *memdb.Txn) error {
// is the simplest way for users to upgrade since custom config sourcer
// plugins aren't yet supported, as of 1/10/2023.
key := string(k)
re := regexp.MustCompile(`aws-ssm|consul|kubernetes|null|packer|terraform-cloud|vault`)
if re.MatchString(key) {
if err := bucket.Delete(k); err != nil {
return err
Expand Down

0 comments on commit 54bb172

Please sign in to comment.